Fixed a dumb bug
This commit is contained in:
parent
30d5ca129e
commit
c805f1fd6b
1 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,7 @@ public class CacheMap {
|
||||||
eachCapacity = initialCapacity / nBuckets + 1;
|
eachCapacity = initialCapacity / nBuckets + 1;
|
||||||
oldTable = new HashMap (eachCapacity, loadFactor);
|
oldTable = new HashMap (eachCapacity, loadFactor);
|
||||||
newTable = new HashMap (eachCapacity, loadFactor);
|
newTable = new HashMap (eachCapacity, loadFactor);
|
||||||
// System.out.println ("CREATED NEW CACHEMAP: CAP="+initialCapacity+" EACH="+eachCapacity);
|
// System.out.println ("CREATED NEW CACHEMAP: CAP="+initialCapacity+" EACH="+eachCapacity+" THRES="+threshold);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Constructs a new, empty hashtable with the specified initial
|
/// Constructs a new, empty hashtable with the specified initial
|
||||||
|
@ -184,7 +184,7 @@ public class CacheMap {
|
||||||
if (size() >= threshold) {
|
if (size() >= threshold) {
|
||||||
// Rotate the tables.
|
// Rotate the tables.
|
||||||
oldTable = newTable;
|
oldTable = newTable;
|
||||||
newTable.clear ();
|
newTable = new HashMap (eachCapacity, loadFactor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return oldValue;
|
return oldValue;
|
||||||
|
|
Loading…
Add table
Reference in a new issue