Skip to content

Commit

Permalink
Null head and tail in clear.
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethshackleton committed Jun 21, 2024
1 parent fbe82ea commit 67f9198
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class FastLinkedStringMap<T>(
override fun clear() {
super.clear()
spare = null
head = null
var entry = tail
while (entry != null) {
val previous = entry.previous
Expand All @@ -69,6 +70,7 @@ class FastLinkedStringMap<T>(
entry.value = null
entry = previous
}
tail = null
}

private fun LinkedEntry<T>.unlink(): Entry<T> = apply {
Expand Down

0 comments on commit 67f9198

Please sign in to comment.