Bug 5952 - Path hashCode and equals
Summary: Path hashCode and equals
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-11-15 10:06 EST by John Arthorne CLA
Modified: 2001-11-20 10:14 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2001-11-15 10:06:27 EST
Code review on core equals/hashCode:

Resource.equals:
 - do the cheap checks first -- check type, then path, then workspace
 - possibly inling accessors

Path.hashCode
 - chain hash values by multiplying by 37

Path.equals
 - test segments in reverse order -- more likely to hit conflict faster
Comment 1 John Arthorne CLA 2001-11-15 14:36:50 EST
Implemented and released.  Minor slowdown in path creation time (due to 
pre-computatation of hashCode), but generally improved hash performance for both 
Path and IResource objects.

The most significant change in terms of performance was to do the path equality 
testing in reverse segment order.  This is more likely to hit different segments 
faster.
Comment 2 Rodrigo Peretti CLA 2001-11-20 10:14:43 EST
Fixed in v211