MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / getFirst

Method getFirst

src/common/classes/sparse_bitmap.h:411–439  ·  view source on GitHub ↗

If method returns false it means list is empty and position of accessor is not defined.

Source from the content-addressed store, hash-verified

409 // If method returns false it means list is empty and
410 // position of accessor is not defined.
411 bool getFirst()
412 {
413 // Small convenience related to fact engine likes to use NULL SparseBitmap pointers
414 if (!bitmap)
415 return false;
416
417 if (bitmap->singular)
418 {
419 current_value = bitmap->singular_value;
420 return true;
421 }
422
423 if (!treeAccessor.getFirst())
424 return false;
425
426 const BUNCH_T tree_bits = treeAccessor.current().bits;
427 bit_mask = BUNCH_ONE;
428 current_value = treeAccessor.current().start_value;
429 do {
430 if (tree_bits & bit_mask)
431 return true;
432 bit_mask <<= 1;
433 current_value++;
434 } while (bit_mask);
435
436 // Bucket must contain one bit at least
437 fb_assert(false);
438 return false;
439 }
440
441 // If method returns false it means list is empty and
442 // position of accessor is not defined.

Callers

nothing calls this directly

Calls 2

getFirstMethod · 0.45
currentMethod · 0.45

Tested by

no test coverage detected