Fixed emberassing bug in prefetchChildren() array index calculation.
(I knew I was too overworked when I wrote the code!)
This commit is contained in:
parent
a358574fed
commit
04bcc845ef
1 changed files with 5 additions and 2 deletions
|
@ -1249,12 +1249,15 @@ public final class Node implements INode, Serializable {
|
||||||
loadNodes ();
|
loadNodes ();
|
||||||
if (subnodes == null)
|
if (subnodes == null)
|
||||||
return;
|
return;
|
||||||
|
if (startIndex >= subnodes.size())
|
||||||
|
return;
|
||||||
int l = Math.min (subnodes.size()-startIndex, length);
|
int l = Math.min (subnodes.size()-startIndex, length);
|
||||||
if (l < 1)
|
if (l < 1)
|
||||||
return;
|
return;
|
||||||
Key[] keys = new Key[l];
|
Key[] keys = new Key[l];
|
||||||
for (int i=startIndex; i<startIndex+l; i++)
|
for (int i=0; i<l; i++) {
|
||||||
keys[i] = ((NodeHandle) subnodes.get (i)).getKey ();
|
keys[i] = ((NodeHandle) subnodes.get (i+startIndex)).getKey ();
|
||||||
|
}
|
||||||
nmgr.nmgr.prefetchNodes (this, dbmap.getSubnodeRelation (), keys);
|
nmgr.nmgr.prefetchNodes (this, dbmap.getSubnodeRelation (), keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue