If method returns false it means list is empty and position of accessor is not defined.
| 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. |