refactor(core): _reset() remove nextRecord (#38752)

The nextRecord is not neccessary, so remove it and use record._nextMoved to iterate

PR Close #38752
This commit is contained in:
gilboom 2020-09-09 14:59:37 +08:00 committed by Andrew Kushnir
parent 0ae00bb1f7
commit 85951a0465
1 changed files with 1 additions and 3 deletions

View File

@ -236,7 +236,6 @@ export class DefaultIterableDiffer<V> implements IterableDiffer<V>, IterableChan
_reset() {
if (this.isDirty) {
let record: IterableChangeRecord_<V>|null;
let nextRecord: IterableChangeRecord_<V>|null;
for (record = this._previousItHead = this._itHead; record !== null; record = record._next) {
record._nextPrevious = record._next;
@ -247,9 +246,8 @@ export class DefaultIterableDiffer<V> implements IterableDiffer<V>, IterableChan
}
this._additionsHead = this._additionsTail = null;
for (record = this._movesHead; record !== null; record = nextRecord) {
for (record = this._movesHead; record !== null; record = record._nextMoved) {
record.previousIndex = record.currentIndex;
nextRecord = record._nextMoved;
}
this._movesHead = this._movesTail = null;
this._removalsHead = this._removalsTail = null;