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

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

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