Skip to content

Commit

Permalink
refactor(core): _reset() remove nextRecord (#38752)
Browse files Browse the repository at this point in the history
The nextRecord is not neccessary, so remove it and use record._nextMoved to iterate

PR Close #38752
  • Loading branch information
gilboom authored and AndrewKushnir committed Sep 10, 2020
1 parent 5de2ac3 commit d8714d0
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit d8714d0

Please sign in to comment.