From 5b7c90beb95f2535c86a2e33784a4f965d77b7cd Mon Sep 17 00:00:00 2001 From: Christopher Barber Date: Mon, 6 May 2019 21:03:54 +0200 Subject: [PATCH] packed_vector insert/push_back optimization --- include/internal/packed_vector.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/internal/packed_vector.hpp b/include/internal/packed_vector.hpp index e4b2221..d82a236 100644 --- a/include/internal/packed_vector.hpp +++ b/include/internal/packed_vector.hpp @@ -459,6 +459,11 @@ namespace dyn{ void insert(uint64_t i, uint64_t x){ + if(i==size()){ + push_back(x); + return; + } + if(bitsize(x)>width_){ //auto vec = to_vector(i,x);