MCPcopy Create free account
hub / github.com/catboost/catboost / GetBlockIdByOffset

Method GetBlockIdByOffset

library/cpp/netliba/v12/block_chain.h:63–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 return Blocks.ysize();
62 }
63 int GetBlockIdByOffset(int offset) const {
64 const auto i = LowerBound(Blocks.cbegin(), Blocks.cend(), offset, TBlockLess());
65 if (i == Blocks.cend())
66 return Blocks.ysize() - 1;
67 if (i->Offset == offset)
68 return (int)(i - Blocks.cbegin());
69 return (int)(i - Blocks.cbegin() - 1);
70 }
71 };
72
73 //////////////////////////////////////////////////////////////////////////

Callers 1

SeekMethod · 0.45

Calls 5

LowerBoundFunction · 0.85
TBlockLessClass · 0.70
cbeginMethod · 0.45
cendMethod · 0.45
ysizeMethod · 0.45

Tested by

no test coverage detected