Commit Graph

2 Commits

Author SHA1 Message Date
Lasse Reichstein Holst Nielsen 8129c40c5e Update LinkedList.contains to take advantage of internal structure.
Made it explicit in the documentation that elements of the `LinkedList`
are compared using identity, not `operator==`, even if they choose to
override that.
The linked list entries are directly linked to their containing list,
which is what defined their containing list. Merely being equal to an entry
of a list does not make another entry belong to that list.

The `contains` method now simply checks that the `list` property of the
the provided entry is the list itself, which matches the existing behavior
of `remove`.

Fixes #44189.

Bug: https://github.com/dart-lang/sdk/issues/44189
Change-Id: Ia6a7fd461ddf18f99121662f87e83415746e1ca4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/172161
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-12-02 14:08:08 +00:00
Ben Konyi e4411375ed Migrated test block 181 to Dart 2.0.
Manually merged collection/linked_list_test. Otherwise, simple block.

Bug:
Change-Id: I30df1dc7b02f0767ea0dcfc8247b2e1ce820aed9
Reviewed-on: https://dart-review.googlesource.com/3741
Reviewed-by: Jennifer Messerly <jmesserly@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2017-09-11 18:24:02 +00:00