From bdccd17936479d4939738d1d9373e3cddede9c40 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 24 Aug 2024 19:29:09 +0100 Subject: [PATCH] fixup! Add implementation --- src/include/interval-map/interval-map.hh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/include/interval-map/interval-map.hh b/src/include/interval-map/interval-map.hh index 1352b79..a514daf 100644 --- a/src/include/interval-map/interval-map.hh +++ b/src/include/interval-map/interval-map.hh @@ -18,12 +18,10 @@ public: auto const end_val = (*this)[end]; underlying_.erase(underlying_.lower_bound(begin), underlying_.upper_bound(end)); - if (!((*this)[begin] == val)) { + if (!((*this)[begin] == val)) underlying_.insert({begin, val}); - } - if (!((*this)[end] == end_val)) { + if (!((*this)[end] == end_val)) underlying_.insert({end, end_val}); - } } V const& operator[](K const& key) const {