mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-08-31 15:43:25 +00:00
fix freezed files bug
This commit is contained in:
@@ -412,10 +412,10 @@ export class TrackSegment extends GPXTreeLeaf {
|
||||
// Producers
|
||||
replace(segment: number, start: number, end: number, points: TrackPoint[]) {
|
||||
return produce(this, (draft) => {
|
||||
let og = getOriginal(draft);
|
||||
let og = getOriginal(draft); // Read as much as possible from the original object because it is faster
|
||||
let trkpt = og.trkpt.slice();
|
||||
trkpt.splice(start, end - start + 1, ...points);
|
||||
draft.trkpt = freeze(trkpt);
|
||||
draft.trkpt = freeze(trkpt); // Pre-freeze the array, faster as well
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user