diff --git a/lib/change_detection/dirty_checking_change_detector.dart b/lib/change_detection/dirty_checking_change_detector.dart index fd86624cb..dbc178bb3 100644 --- a/lib/change_detection/dirty_checking_change_detector.dart +++ b/lib/change_detection/dirty_checking_change_detector.dart @@ -175,12 +175,12 @@ class DirtyCheckingChangeDetectorGroup implements ChangeDetectorGroup { DirtyCheckingRecord _recordAdd(DirtyCheckingRecord record) { DirtyCheckingRecord previous = _recordTail; - DirtyCheckingRecord next = previous == null ? null : previous._nextRecord; + DirtyCheckingRecord next = previous._nextRecord; record._nextRecord = next; record._prevRecord = previous; - if (previous != null) previous._nextRecord = record; + previous._nextRecord = record; if (next != null) next._prevRecord = record; _recordTail = record; @@ -194,7 +194,8 @@ class DirtyCheckingChangeDetectorGroup implements ChangeDetectorGroup { DirtyCheckingRecord previous = record._prevRecord; DirtyCheckingRecord next = record._nextRecord; - if (record == _recordHead && record == _recordTail) { + if (_recordHead == _recordTail) { + assert(record == _recordHead); // we are the last one, must leave marker behind. _recordHead = _recordTail = _marker; _marker._nextRecord = next;