Files
swift-collections/Sources
Karoy Lorentey ead6314a1c [Deque]: Fix bogus assert in Deque._Storage._ensureUnique
A non-unique reference to a storage instance can legitimately become unique at any point, due to other references (say, held, by another thread) getting destroyed.

`Deque`’s `ensureUnique` implementation currently invokes the uniqueness check two times in quick succession, expecting it to return false both times. In rare circumstances, this can lead to a spurious trap in concurrent environments.

Fix this by avoiding calling `isUnique` more than once.
2024-05-24 13:13:00 -07:00
..