On Mon, 8 Jan 2024 16:01:01 GMT, Andy Goryachev <ango...@openjdk.org> wrote:
>> John Hendrikx has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains eight additional >> commits since the last revision: >> >> - Merge branch 'master' into feature/selector-performance-improvement >> - Add since tag to new API >> - Add deprecated annotation and fixed deprecation descriptions >> - Use copyOf instead of Collections.unmodifiableList(new ArrayList<>(x)) >> - Pull up frozen field to abstract FixedCapacitySet class >> - Add copyright header >> - Deprecate StyleClass and remove StyleClassSet for faster solution >> - Fix regression > > modules/javafx.graphics/src/main/java/javafx/css/SimpleSelector.java line 382: > >> 380: hash = 31 * (hash + name.hashCode()); >> 381: hash = 31 * (hash + selectorStyleClassNames.hashCode()); >> 382: hash = 31 * (hash + selectorStyleClassNames.hashCode()); > > this pattern destroys some information that otherwise should be used to > produce a better hash code. > instead of > `hash = 31 * (hash + newPart);` > it should be > `hash = 31 * hash + newPart;` > > (also in CompoundSelector) I agree that it is not nice :) However, changing this seems out of scope for this PR as my changes are unrelated to this, and I didn't even touch `CompoundSelector`. As selectors are never stored in sets/maps, it is hard to justify changing this as part of this PR as it would not be related to improving performance. ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1316#discussion_r1444941427