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

Method Split

library/cpp/yt/memory/ref.cpp:315–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315std::vector<TSharedRef> TSharedRef::Split(size_t partSize) const
316{
317 YT_VERIFY(partSize > 0);
318 std::vector<TSharedRef> result;
319 if (partSize >= Size()) {
320 result.push_back(Slice(Begin(), End()));
321 return result;
322 }
323 result.reserve(Size() / partSize + 1);
324 auto sliceBegin = Begin();
325 while (sliceBegin < End()) {
326 auto sliceEnd = sliceBegin + partSize;
327 if (sliceEnd > End()) {
328 sliceEnd = End();
329 }
330 result.push_back(Slice(sliceBegin, sliceEnd));
331 sliceBegin = sliceEnd;
332 }
333 return result;
334}
335
336////////////////////////////////////////////////////////////////////////////////
337

Callers 15

mainFunction · 0.45
mainFunction · 0.45
CompressPathFunction · 0.45
mainFunction · 0.45
TParsedHttpLocationMethod · 0.45
TryParseStringToVectorFunction · 0.45
LoadMethod · 0.45
UpdateFromDataMethod · 0.45

Calls 4

BeginClass · 0.85
SizeFunction · 0.50
push_backMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected