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

Method append

library/cpp/containers/paged_vector/paged_vector.h:284–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282
283 template <typename TIter>
284 void append(TIter b, TIter e) {
285 size_t sz = e - b;
286 size_t sz1 = Min<size_t>(sz, PageSize - CurrentPageSize());
287 size_t sz2 = (sz - sz1) / PageSize;
288 size_t sz3 = (sz - sz1) % PageSize;
289
290 if (sz1) {
291 PrepareAppend();
292 TPage& p = CurrentPage();
293 p.insert(p.end(), b, b + sz1);
294 }
295
296 for (size_t i = 0; i < sz2; ++i) {
297 AllocateNewPage();
298 TPage& p = CurrentPage();
299 p.insert(p.end(), b + sz1 + i * PageSize, b + sz1 + (i + 1) * PageSize);
300 }
301
302 if (sz3) {
303 AllocateNewPage();
304 TPage& p = CurrentPage();
305 p.insert(p.end(), b + sz1 + sz2 * PageSize, e);
306 }
307 }
308
309 iterator erase(iterator it) {
310 size_t pnum = PageNumber(it.Offset);

Callers 15

parse_qs_binaryFunction · 0.45
parse_qsl_binaryFunction · 0.45
unquote_binaryFunction · 0.45
_printFunction · 0.45
iter_modulesMethod · 0.45
__res.pyFile · 0.45
erroneous_funcFunction · 0.45
reservoir_samplingFunction · 0.45
getFunction · 0.45
stable_uniqFunction · 0.45
splitFunction · 0.45

Calls 2

insertMethod · 0.45
endMethod · 0.45

Tested by 15

erroneous_funcFunction · 0.36
test_memoize_thread_safeFunction · 0.36
test_filelockFunction · 0.36
test_concurrent_lockFunction · 0.36
add_subtestMethod · 0.36
_unify_pathFunction · 0.36
colorize_pytest_errorFunction · 0.36
_import_conftestFunction · 0.36
get_shuffled_chunkFunction · 0.36