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

Method Seek

library/cpp/netliba/v6/ib_memstream.cpp:71–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69 }
70
71 i64 TIBMemStream::Seek(i64 pos) {
72 for (int resBlockId = 0; resBlockId < Blocks.ysize(); ++resBlockId) {
73 const TBlock& blk = Blocks[resBlockId];
74 if (pos < blk.StartOffset + blk.DataSize) {
75 CurBlock = resBlockId;
76 CurBlockOffset = pos - blk.StartOffset;
77 return pos;
78 }
79 }
80 CurBlock = Blocks.ysize();
81 CurBlockOffset = 0;
82 return GetLength();
83 }
84
85 void TIBMemStream::GetBlocks(TVector<TBlockDescr>* res) const {
86 int blockCount = Blocks.ysize();

Callers 2

SendDataMethod · 0.45
GetCapturedStringMethod · 0.45

Calls 2

GetLengthFunction · 0.50
ysizeMethod · 0.45

Tested by

no test coverage detected