mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
CharacterView was not Hashable, so Set could not be used as an accumulator. String and Substring are Hashable, but using a Set as an accumulator is still slower than first collecting all the results in an Array and then transforming it to a Set at the end. One possible reason why that could be the case, is that by the time conversion happens, we already know the capacity and thus will not re-allocate and re-hash a Set on every insertion beyong current capacity.
1.8 KiB
1.8 KiB