Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/coding
diff options
context:
space:
mode:
authorYuri Gorshenin <y@maps.me>2016-07-04 16:24:47 +0300
committerYuri Gorshenin <y@maps.me>2016-07-05 12:40:47 +0300
commit7df300bc547e7fbb845ff3cedf95d27b61a7ad73 (patch)
treed058fe814917d70bf9cff3e95f4eb11bd6c15c4e /coding
parent36fe4a08508b790a16677465e2e0ed5db70f0414 (diff)
Minor fixes - get rid of redundant copying.
Diffstat (limited to 'coding')
-rw-r--r--coding/compressed_bit_vector.hpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/coding/compressed_bit_vector.hpp b/coding/compressed_bit_vector.hpp
index 5fcf630919..925759d83d 100644
--- a/coding/compressed_bit_vector.hpp
+++ b/coding/compressed_bit_vector.hpp
@@ -5,6 +5,7 @@
#include "coding/writer.hpp"
#include "base/assert.hpp"
+#include "base/ref_counted.hpp"
#include "std/algorithm.hpp"
#include "std/unique_ptr.hpp"
@@ -13,7 +14,7 @@
namespace coding
{
-class CompressedBitVector
+class CompressedBitVector : public my::RefCounted
{
public:
enum class StorageStrategy
@@ -250,10 +251,10 @@ public:
{
uint64_t const kBase = 127;
uint64_t hash = 0;
- CompressedBitVectorEnumerator::ForEach(cbv, [&](uint64_t i)
+ CompressedBitVectorEnumerator::ForEach(cbv, [&hash](uint64_t i)
{
- hash = hash * kBase + i;
- });
+ hash = hash * kBase + i + 1;
+ });
return hash;
}
};