]> source.dussan.org Git - jackcess.git/commitdiff
do not increment unique entry count when replacing an existing entry
authorJames Ahlborn <jtahlborn@yahoo.com>
Mon, 28 Aug 2023 21:21:54 +0000 (21:21 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Mon, 28 Aug 2023 21:21:54 +0000 (21:21 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@1400 f203690c-595d-4dc9-a70b-905162fa7fd2

src/main/java/com/healthmarketscience/jackcess/impl/IndexData.java

index 1c430fc686e65666c4c807fb908be0855931fcdc..c08e70b8c6ef98f5035cad4bdca6f4f34fb3581d 100644 (file)
@@ -685,7 +685,9 @@ public class IndexData {
   {
     if(newEntry != null) {
       dataPage.addEntry(idx, newEntry);
-      if(!isDupeEntry) {
+      // if we are adding a duplicate entry, or replacing an existing entry,
+      // then the unique entry count doesn't change
+      if(!isDupeEntry && (oldEntry == null)) {
         ++_uniqueEntryCount;
       }
       ++_modCount;