Skip to content

Commit e94a3c3

Browse files
committed
Remove unused field, fix LruCache.
1 parent 6ecd000 commit e94a3c3

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

build/lib/src/library_cycle_graph/library_cycle_graph_loader.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ class LibraryCycleGraphLoader {
7373
/// for its sorting, so earlier phases are processed first in [_nextIdToLoad].
7474
final SplayTreeMap<int, List<AssetId>> _idsToLoad = SplayTreeMap();
7575

76-
final List<(int, AssetId)> _loadingIds = [];
77-
7876
/// All loaded library cycles, by asset.
7977
final Map<AssetId, PhasedValue<LibraryCycle>> _cycles = {};
8078

@@ -136,7 +134,6 @@ class LibraryCycleGraphLoader {
136134
// Return the last ID from the list of IDs at this phase because it's
137135
// cheapest to remove in `_removeIdToLoad`.
138136
final result = first.value.last;
139-
_loadingIds.add((first.key, result));
140137
return (first.key, result);
141138
}
142139

build/lib/src/state/lru_cache.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ class LruCache<K, V> {
5555
_currentWeightTotal -= entry.weight;
5656
_entries.remove(key);
5757

58+
// Remove from linked list.
59+
entry.previous?.next = entry.next;
60+
entry.next?.previous = entry.previous;
61+
5862
if (entry == _tail) {
5963
_tail = entry.next;
60-
_tail?.previous = null;
6164
}
6265
if (entry == _head) {
6366
_head = entry.previous;
64-
_head?.next = null;
6567
}
6668

6769
return entry.value;
@@ -75,12 +77,9 @@ class LruCache<K, V> {
7577
_tail = link.next;
7678
}
7779

78-
if (link.previous != null) {
79-
link.previous!.next = link.next;
80-
}
81-
if (link.next != null) {
82-
link.next!.previous = link.previous;
83-
}
80+
// Remove from linked list.
81+
link.previous?.next = link.next;
82+
link.next?.previous = link.previous;
8483

8584
_head?.next = link;
8685
link.previous = _head;

tool/leak_check.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ fi
1414
dart test/invalidation/invalidation_leak_checker.dart setup
1515

1616
leak_amount=$(dart test/invalidation/invalidation_leak_checker.dart)
17-
leak_limit=60000
17+
leak_limit=15000
1818

19-
if test $((leak_amount)) -gt 60000; then
19+
if test $((leak_amount)) -gt "$leak_limit"; then
2020
echo "Measured leak size $leak_amount > $leak_limit, failing!"
2121
exit 1
2222
else
@@ -30,4 +30,7 @@ fi
3030
# 52455, 52332, 52308
3131
#
3232
# Initial check-in with https://dart-review.googlesource.com/c/sdk/+/441740:
33-
# 21482, 11568, 13186
33+
# 21482, 11568, 13186
34+
#
35+
# After `build_runner` leak fixes and analyzer 7.7.1 with 441740:
36+
# 13147, 12515, 13320

0 commit comments

Comments
 (0)