diff --git a/conanfile.py b/conanfile.py index 525c415..46d3244 100644 --- a/conanfile.py +++ b/conanfile.py @@ -5,7 +5,7 @@ class Pkg(ConanFile): name = "bpd" - version = "0.2.7" + version = "0.2.8" license = "MIT" author = "Cooper Larson | cooper.larson1@gmail.com" url = "" diff --git a/include/BoundedPriorityDeque.hpp b/include/BoundedPriorityDeque.hpp index 37ecf6f..49bae55 100644 --- a/include/BoundedPriorityDeque.hpp +++ b/include/BoundedPriorityDeque.hpp @@ -257,7 +257,13 @@ class BoundedPriorityDequeBase { * @param key The bounding key value * @param value The data held by the bounding pair. */ - void emplace(K key, const V& value) { push({ key, value }); } + void emplace(K key, const V& value) { + if (_size == _k) { + if (compare(key, _buffer[_tail].key)) _popBottom(); + else return; + } + insert({ key, value }); + } /** * @brief Inserts an element into the vector. @@ -270,7 +276,7 @@ class BoundedPriorityDequeBase { */ void push(const BoundingPair& element) { if (_size == _k) { - if (compare(element.key, _buffer[_tail].key)) popBottom(); + if (compare(element.key, _buffer[_tail].key)) _popBottom(); else return; } insert(element); diff --git a/meson.build b/meson.build index 8caebae..da3a646 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('bpd', 'cpp', - version : '0.2.7', + version : '0.2.8', default_options : ['warning_level=3', 'cpp_std=c++23', 'optimization=3', 'buildtype=release']) source_root = meson.source_root()