diff --git a/cpp/src/db/id_generators.cpp b/cpp/src/db/id_generators.cpp index 3541048413..bb7da2c70d 100644 --- a/cpp/src/db/id_generators.cpp +++ b/cpp/src/db/id_generators.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "id_generators.h" @@ -17,18 +18,17 @@ IDNumber SimpleIDGenerator::getNextIDNumber() { return micros * MAX_IDS_PER_MICRO; } -IDNumbers&& SimpleIDGenerator::getNextIDNumbers(size_t n) { +void SimpleIDGenerator::getNextIDNumbers(size_t n, IDNumbers& ids) { assert(n < MAX_IDS_PER_MICRO); auto now = std::chrono::system_clock::now(); auto micros = std::chrono::duration_cast( now.time_since_epoch()).count(); micros *= MAX_IDS_PER_MICRO; - IDNumbers ids = IDNumbers(n); + ids.clear(); for (int pos=0; pos