RFR: 6805750: Improve handling of Attributes.Name

Claes Redestad claes.redestad at oracle.com
Sun Apr 22 21:40:16 UTC 2018


Hi,


On 2018-04-20 19:41, Xueming Shen wrote:
> Claes,
>
> It loogsk good.

thanks!

>
> One minor nit is that the "hashCode" check in Name.equals() might not 
> be really
> necessary, given in most/normal use scenario the "Name" is used as a 
> key in
> Attributes.map, which is a LinkedHashMap. Arguably the hashcode should be
> check already during lookup. 

Agreed; I hadn't analyzed that particular check and seems it costs more 
in well-behaved
cased than it would ever save us in the presence of excessive hash 
collisions. I'll remove
it before push.

Thanks!

/Claes


More information about the core-libs-dev mailing list