From 369dc4c8b3331aa318f2a98eb973d0840541297d Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 3 Jul 2023 16:52:11 -0400 Subject: Slightly optimized merge function --- include/shard/PGM.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/shard/PGM.h b/include/shard/PGM.h index 73688ae..20bdbf2 100644 --- a/include/shard/PGM.h +++ b/include/shard/PGM.h @@ -342,12 +342,20 @@ public: } static std::vector merge(std::vector> &results) { + size_t total = 0; + for (size_t i=0; i(); + } + std::vector output; + output.reserve(total); for (size_t i=0; i