mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Do not copy on keyframes.Slice if not needed
This commit is contained in:
parent
7a827139b7
commit
27d769cd07
@ -37,7 +37,12 @@ func (kf *Keyframe) Slice(start int32, end int32) []float64 {
|
||||
}
|
||||
kf.info.mutex.RLock()
|
||||
defer kf.info.mutex.RUnlock()
|
||||
|
||||
ref := kf.Keyframes[start:end]
|
||||
if kf.IsDone {
|
||||
return ref
|
||||
}
|
||||
// make a copy since we will continue to mutate the array.
|
||||
ret := make([]float64, end-start)
|
||||
copy(ret, ref)
|
||||
return ret
|
||||
|
Loading…
x
Reference in New Issue
Block a user