You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by al...@apache.org on 2022/08/18 21:28:45 UTC

[datasketches-cpp] branch master updated: Update reverse_purge_hash_map copy constructor

This is an automated email from the ASF dual-hosted git repository.

alsay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/datasketches-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new 8e109f3  Update  reverse_purge_hash_map copy constructor
     new c966a30  Merge pull request #299 from why520it/why520it-patch-1
8e109f3 is described below

commit 8e109f3926f8d3be13f61cb4124cac51e46a5352
Author: why520it <76...@users.noreply.github.com>
AuthorDate: Wed Aug 17 18:00:57 2022 +0800

    Update  reverse_purge_hash_map copy constructor
    
    I think reverse_purge_hash_map copy constructor should do this here, the original result is not being able to copy all the values
---
 fi/include/reverse_purge_hash_map_impl.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fi/include/reverse_purge_hash_map_impl.hpp b/fi/include/reverse_purge_hash_map_impl.hpp
index 0b05d89..77461de 100644
--- a/fi/include/reverse_purge_hash_map_impl.hpp
+++ b/fi/include/reverse_purge_hash_map_impl.hpp
@@ -71,8 +71,8 @@ states_(nullptr)
       if (other.states_[i] > 0) {
         new (&keys_[i]) K(other.keys_[i]);
         values_[i] = other.values_[i];
+         if (--num == 0) break;
       }
-      if (--num == 0) break;
     }
   }
   std::copy(other.states_, other.states_ + size, states_);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org