Skip to content

Commit

Permalink
JavaScript array sorts in place
Browse files Browse the repository at this point in the history
  • Loading branch information
flyover committed Feb 3, 2016
1 parent cf51f51 commit ac8260e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions spine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,7 @@ spine.AnimBone.prototype.load = function(json) {
anim_bone.min_time = Math.min(anim_bone.min_time, translate_keyframe.time);
anim_bone.max_time = Math.max(anim_bone.max_time, translate_keyframe.time);
});
anim_bone.translate_keyframes = anim_bone.translate_keyframes.sort(spine.Keyframe.compare);
anim_bone.translate_keyframes.sort(spine.Keyframe.compare);
break;
case 'rotate':
anim_bone.rotate_keyframes = [];
Expand All @@ -1675,7 +1675,7 @@ spine.AnimBone.prototype.load = function(json) {
anim_bone.min_time = Math.min(anim_bone.min_time, rotate_keyframe.time);
anim_bone.max_time = Math.max(anim_bone.max_time, rotate_keyframe.time);
});
anim_bone.rotate_keyframes = anim_bone.rotate_keyframes.sort(spine.Keyframe.compare);
anim_bone.rotate_keyframes.sort(spine.Keyframe.compare);
break;
case 'scale':
anim_bone.scale_keyframes = [];
Expand All @@ -1685,7 +1685,7 @@ spine.AnimBone.prototype.load = function(json) {
anim_bone.min_time = Math.min(anim_bone.min_time, scale_keyframe.time);
anim_bone.max_time = Math.max(anim_bone.max_time, scale_keyframe.time);
});
anim_bone.scale_keyframes = anim_bone.scale_keyframes.sort(spine.Keyframe.compare);
anim_bone.scale_keyframes.sort(spine.Keyframe.compare);
break;
default:
console.log("TODO: spine.AnimBone::load", key);
Expand Down Expand Up @@ -1803,7 +1803,7 @@ spine.AnimSlot.prototype.load = function(json) {
anim_slot.max_time = Math.max(anim_slot.max_time, color_keyframe.time);
anim_slot.color_keyframes.push(color_keyframe);
});
anim_slot.color_keyframes = anim_slot.color_keyframes.sort(spine.Keyframe.compare);
anim_slot.color_keyframes.sort(spine.Keyframe.compare);
break;
case 'attachment':
anim_slot.attachment_keyframes = [];
Expand All @@ -1813,7 +1813,7 @@ spine.AnimSlot.prototype.load = function(json) {
anim_slot.max_time = Math.max(anim_slot.max_time, attachment_keyframe.time);
anim_slot.attachment_keyframes.push(attachment_keyframe);
});
anim_slot.attachment_keyframes = anim_slot.attachment_keyframes.sort(spine.Keyframe.compare);
anim_slot.attachment_keyframes.sort(spine.Keyframe.compare);
break;
default:
console.log("TODO: spine.AnimSlot::load", key);
Expand Down Expand Up @@ -1979,7 +1979,7 @@ spine.AnimIkc.prototype.load = function(json) {
anim_ikc.max_time = Math.max(anim_ikc.max_time, ikc_keyframe.time);
anim_ikc.ikc_keyframes.push(ikc_keyframe);
});
anim_ikc.ikc_keyframes = anim_ikc.ikc_keyframes.sort(spine.Keyframe.compare);
anim_ikc.ikc_keyframes.sort(spine.Keyframe.compare);

return anim_ikc;
}
Expand Down Expand Up @@ -2048,7 +2048,7 @@ spine.FfdAttachment.prototype.load = function(json) {
ffd_attachment.ffd_keyframes.push(ffd_keyframe);
});

ffd_attachment.ffd_keyframes = ffd_attachment.ffd_keyframes.sort(spine.Keyframe.compare);
ffd_attachment.ffd_keyframes.sort(spine.Keyframe.compare);

return ffd_attachment;
}
Expand Down Expand Up @@ -2231,7 +2231,7 @@ spine.Animation.prototype.load = function(json) {
anim.max_time = Math.max(anim.max_time, event_keyframe.time);
anim.event_keyframes.push(event_keyframe);
});
anim.event_keyframes = anim.event_keyframes.sort(spine.Keyframe.compare);
anim.event_keyframes.sort(spine.Keyframe.compare);
break;
case 'drawOrder':
case 'draworder':
Expand All @@ -2242,7 +2242,7 @@ spine.Animation.prototype.load = function(json) {
anim.max_time = Math.max(anim.max_time, order_keyframe.time);
anim.order_keyframes.push(order_keyframe);
});
anim.order_keyframes = anim.order_keyframes.sort(spine.Keyframe.compare);
anim.order_keyframes.sort(spine.Keyframe.compare);
break;
case 'ik':
Object.keys(json[key] || {}).forEach(function(ikc_key) {
Expand Down

0 comments on commit ac8260e

Please sign in to comment.