MCPcopy Index your code
hub / github.com/jankotek/mapdb / findChild

Method findChild

src/main/java/org/mapdb/BTreeMapJava.java:220–239  ·  view source on GitHub ↗
(GroupSerializer keySerializer, Node node, Comparator comparator, Object key)

Source from the content-addressed store, hash-verified

218
219
220 static long findChild(GroupSerializer keySerializer, Node node, Comparator comparator, Object key){
221 if(CC.ASSERT && !node.isDir())
222 throw new AssertionError();
223 //find an index
224 int pos = keySerializer.valueArraySearch(node.keys, key, comparator);
225
226 if(pos<0)
227 pos = -pos-1;
228
229 pos += -1+node.intLeftEdge();
230
231 pos = Math.max(0, pos);
232 long[] children = (long[]) node.values;
233 if(pos>=children.length) {
234 if(CC.ASSERT && node.isRightEdge())
235 throw new AssertionError();
236 return node.link;
237 }
238 return children[pos];
239 }
240
241
242

Callers

nothing calls this directly

Calls 5

isDirMethod · 0.80
intLeftEdgeMethod · 0.80
isRightEdgeMethod · 0.80
valueArraySearchMethod · 0.65
maxMethod · 0.45

Tested by

no test coverage detected