53 |
|
* (STRONG, |
54 |
|
* new Equivalence<Person>() { |
55 |
|
* public boolean equal(Person k, Object x) { |
56 |
< |
* return x instanceOf Person && k.name.equals(((Person)x).name); |
56 |
> |
* return x instanceof Person && k.name.equals(((Person)x).name); |
57 |
|
* } |
58 |
|
* public int hash(Object x) { |
59 |
< |
* return (x instanceOf Person)? ((Person)x).name.hashCode() : 0; |
59 |
> |
* return (x instanceof Person)? ((Person)x).name.hashCode() : 0; |
60 |
|
* } |
61 |
|
* }, |
62 |
|
* STRONG, EQUALS, 0); |
533 |
|
int sc = (int)((1L + (4L * es) / 3) >>> SEGMENT_BITS); |
534 |
|
if (sc < MIN_SEGMENT_CAPACITY) |
535 |
|
sc = MIN_SEGMENT_CAPACITY; |
536 |
< |
else if (sc > MAX_SEGMENT_CAPACITY) |
537 |
< |
sc = MAX_SEGMENT_CAPACITY; |
538 |
< |
this.initialSegmentCapacity = sc; |
536 |
> |
int capacity = MIN_SEGMENT_CAPACITY; // ensure power of two |
537 |
> |
while (capacity < sc) |
538 |
> |
capacity <<= 1; |
539 |
> |
if (capacity > MAX_SEGMENT_CAPACITY) |
540 |
> |
capacity = MAX_SEGMENT_CAPACITY; |
541 |
> |
this.initialSegmentCapacity = capacity; |
542 |
|
} |
543 |
|
this.segments = (Segment[])new Segment[NSEGMENTS]; |
544 |
|
} |
959 |
|
while (p != null) { |
960 |
|
Node n = p.getLinkage(); |
961 |
|
if (p.get() != null && p.getValue() != null) { |
962 |
+ |
pred = p; |
963 |
+ |
p = n; |
964 |
+ |
} |
965 |
+ |
else { |
966 |
|
if (pred == null) |
967 |
|
tab[i] = n; |
968 |
|
else |
970 |
|
seg.decrementCount(); |
971 |
|
p = n; |
972 |
|
} |
966 |
– |
else { |
967 |
– |
pred = p; |
968 |
– |
p = n; |
969 |
– |
} |
973 |
|
} |
974 |
|
} |
975 |
|
} finally { |