RFR: 8166365: Small immutable collections should provide optimized implementations when possible
Claes Redestad
claes.redestad at oracle.com
Wed Jan 11 16:12:54 UTC 2017
Hi Attila,
On 01/11/2017 05:01 PM, Attila Szegedi wrote:
> Collections.java:
>
> 4987 @Override
> 4988 public int hashCode() {
> 4989 return (k == null ? 0 : k.hashCode()) ^
> 4990 (v == null ? 0 : v.hashCode());
>
> Why not use Objects.hashCode here too, that is return Objects.hashCode(k) ^ Objects.hashCode(v) ?
why not, indeed. Updated in-place.
Thanks!
/Claes
>
> Attila.
>
>> On 11 Jan 2017, at 14:43, Claes Redestad <claes.redestad at oracle.com> wrote:
>>
>>> ...
>> All done:
>>
>> http://cr.openjdk.java.net/~redestad/8166365/webrev.02/
>>
>> Thanks for the thorough review!
>>
>> /Claes
More information about the core-libs-dev
mailing list