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

Method insert

library/cpp/containers/paged_vector/paged_vector.h:335–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333 }
334
335 iterator insert(iterator it, const value_type& v) {
336 size_t pnum = PageNumber(it.Offset);
337 size_t pidx = InPageIndex(it.Offset);
338
339 PrepareAppend();
340
341 for (size_t p = NPages() - 1; p > pnum; --p) {
342 PageAt(p).insert(PageAt(p).begin(), PageAt(p - 1).back());
343 PageAt(p - 1).pop_back();
344 }
345
346 PageAt(pnum).insert(PageAt(pnum).begin() + pidx, v);
347 return it;
348 }
349
350 template <typename TIter>
351 void insert(iterator it, TIter b, TIter e) {

Callers 2

appendMethod · 0.45
Test7Method · 0.45

Calls 4

insertFunction · 0.50
beginMethod · 0.45
backMethod · 0.45
pop_backMethod · 0.45

Tested by 1

Test7Method · 0.36