]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common/bit_vector: fix IteratorImpl post-increment operator
authorIlya Dryomov <idryomov@gmail.com>
Sat, 6 Jan 2024 11:22:35 +0000 (12:22 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Fri, 2 Feb 2024 14:36:57 +0000 (15:36 +0100)
It's totally broken: instead of returning the current position and
moving to the next position, it returns the next position and doesn't
move anywhere.  Luckily it hasn't been used until now.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit 2ab5b52f71c88cb55f8ed82f1dfd0115fdd6e022)

src/common/bit_vector.hpp

index 9ce3e8b1ebb2320754b76c84c4619d157373e49d..09ac98b32c3bb9e4da2100d4723706318e854ff5 100644 (file)
@@ -129,7 +129,7 @@ public:
 
     inline IteratorImpl operator++(int) {
       IteratorImpl iterator_impl(*this);
-      ++iterator_impl;
+      ++*this;
       return iterator_impl;
     }
     inline IteratorImpl operator+(uint64_t offset) {