On Mon, 8 Jan 2024 16:19:05 GMT, John Hendrikx <jhendr...@openjdk.org> wrote:

>> 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.

these lines discard about 4.5 bits of information on each step, surely that 
will affect performance, no?

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1316#discussion_r1444947194

Reply via email to