diff options
author | RĂ¼diger Klaehn <rklaehn@gmail.com> | 2014-01-16 21:39:56 +0100 |
---|---|---|
committer | RĂ¼diger Klaehn <rklaehn@gmail.com> | 2014-01-16 21:39:56 +0100 |
commit | 034f6b9452265dcd0e7493ed29971c8864b95c35 (patch) | |
tree | 5b584d8c4e982be09a96567b471062dc4dd9f049 /test/junit | |
parent | dddf1f5a79b1f00b6b173439f3df9e9d2f82af3b (diff) | |
download | scala-034f6b9452265dcd0e7493ed29971c8864b95c35.tar.gz scala-034f6b9452265dcd0e7493ed29971c8864b95c35.tar.bz2 scala-034f6b9452265dcd0e7493ed29971c8864b95c35.zip |
SI-6253 HashSet should implement union
Implements of HashSet.union that reuses the two trees as much as
possible when calculating the union of two sets. This leads to significant
performance improvements as well as to much better structural sharing.
There is a comprehensive correctness test for union since there was not a single test
for HashSet.union before. In addition, there are some tests of the desirable
properties of the new implementation (structural sharing and efficiency
regarding calls of key.hashCode).
The other operations diff and intersect, which are conceptually very
similar to union, are also implemented along with comprehensive test cases
for both correctness and structural sharing.
Note that while it appears that there is some code duplication between the
three methods, they are sufficiently different that it is not possible
to merge them into one without sacrificing performance.
Diffstat (limited to 'test/junit')
0 files changed, 0 insertions, 0 deletions