From b324e4dcee0ced34c4135f68faba0ff17812766a Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 20 Jul 2022 11:00:37 +1000 Subject: Fix setting end element empty. --- src/SparseVector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SparseVector.h') diff --git a/src/SparseVector.h b/src/SparseVector.h index 31636165a..31815c789 100644 --- a/src/SparseVector.h +++ b/src/SparseVector.h @@ -77,7 +77,7 @@ public: const Sci::Position startPartition = starts->PositionFromPartition(partition); if (value == T()) { // Setting the empty value is equivalent to deleting the position - if (position == 0) { + if (position == 0 || position == Length()) { ClearValue(partition); } else if (position == startPartition) { // Currently an element at this position, so remove -- cgit v1.2.3