mirror of
https://github.com/yuzu-mirror/sirit.git
synced 2026-01-18 22:10:15 +01:00
While looping here does work fine, it's mildly inefficient, particularly if the number of members being added is large, because it can result in multiple allocations over the period of the insertion, depending on how much extra memory push_back may allocate for successive elements. Instead, we can just tell the std::vector that we want to slap the whole contained sequence at the back of it with insert, which lets it allocate the whole memory block in one attempt. |
||
|---|---|---|
| .. | ||
| instructions | ||
| .gitignore | ||
| CMakeLists.txt | ||
| common_types.h | ||
| literal_number.cpp | ||
| literal_number.h | ||
| literal_string.cpp | ||
| literal_string.h | ||
| op.cpp | ||
| op.h | ||
| operand.cpp | ||
| operand.h | ||
| sirit.cpp | ||
| stream.cpp | ||
| stream.h | ||