提交 efad557d 编写于 作者: T Takahiro 提交者: Mr.doob

Skip the last keyframe operation of KeyframeTrackPrototype.optimize() if times.length <= 1 (#9691)

上级 c7a68138
......@@ -336,6 +336,8 @@ KeyframeTrackPrototype = {
// flush last keyframe (compaction looks ahead)
if ( lastIndex > 0 ) {
times[ writeIndex ] = times[ lastIndex ];
for ( var readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++ j )
......@@ -344,6 +346,8 @@ KeyframeTrackPrototype = {
++ writeIndex;
}
if ( writeIndex !== times.length ) {
this.times = AnimationUtils.arraySlice( times, 0, writeIndex );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册