MCPcopy Create free account
hub / github.com/KasperskyLab/hrtng / FindBlockByKey

Function FindBlockByKey

src/unflat.cpp:495–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493 }
494
495 int FindBlockByKey(Key_t key)
496 {
497 auto itJz = KeyToBlockJz.find(key);
498 if (itJz != KeyToBlockJz.end())
499 return itJz->second;
500
501 auto itJle = KeyToBlockJle.lower_bound(key);
502 if (itJle != KeyToBlockJle.end())
503 return itJle->second;
504
505 auto itJg = KeyToBlockJg.upper_bound(key);
506 if (itJg != KeyToBlockJg.begin()) {
507 itJg--;
508 if (itJg->first <= key) // if (itJg->first == key - 1)
509 return itJg->second;
510 }
511
512 if (lastJnzTrg != -1)
513 return lastJnzTrg;
514 return -1;
515 }
516};
517
518#if DEBUG_UF >= 4

Callers

nothing calls this directly

Calls 2

endMethod · 0.80
beginMethod · 0.80

Tested by

no test coverage detected