Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

perf(dccd): Drop useless checks #1256

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/change_detection/dirty_checking_change_detector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ class DirtyCheckingChangeDetectorGroup<H> implements ChangeDetectorGroup<H> {

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;
Expand All @@ -194,7 +194,8 @@ class DirtyCheckingChangeDetectorGroup<H> implements ChangeDetectorGroup<H> {
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;
Expand Down