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
diff options
context:
space:
mode:
authorDenis Koronchik <denis@mapswithme.com>2014-07-30 13:35:14 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:22:51 +0300
commit6e78763840c6743bf1417ad50e7fb361a805a0fa (patch)
treebf49ab189b3799a9b44ea16ffb92fd030257dab3 /indexer/interval_index.hpp
parent9b93d7da0b8d9c73501bd1865bb336323c7ed625 (diff)
[optimization] Improve speed of interval index
Diffstat (limited to 'indexer/interval_index.hpp')
-rw-r--r--indexer/interval_index.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/indexer/interval_index.hpp b/indexer/interval_index.hpp
index 1712784bd7..57518aaba9 100644
--- a/indexer/interval_index.hpp
+++ b/indexer/interval_index.hpp
@@ -88,9 +88,12 @@ private:
void ForEachLeaf(F const & f, uint64_t const beg, uint64_t const end,
uint32_t const offset, uint32_t const size) const
{
- buffer_vector<uint8_t, 1024> data(size);
+ buffer_vector<uint8_t, 1024> data;
+ data.resize_no_init(size);
+
m_Reader.Read(offset, &data[0], size);
ArrayByteSource src(&data[0]);
+
void const * pEnd = &data[0] + size;
uint32_t value = 0;
while (src.Ptr() < pEnd)
@@ -126,9 +129,12 @@ private:
uint32_t const end0 = static_cast<uint32_t>(end >> skipBits);
ASSERT_LESS(end0, (1U << m_Header.m_BitsPerLevel), (beg, end, skipBits));
- buffer_vector<uint8_t, 576> data(size);
+ buffer_vector<uint8_t, 576> data;
+ data.resize_no_init(size);
+
m_Reader.Read(offset, &data[0], size);
ArrayByteSource src(&data[0]);
+
uint32_t const offsetAndFlag = ReadVarUint<uint32_t>(src);
uint32_t childOffset = offsetAndFlag >> 1;
if (offsetAndFlag & 1)