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:
authorMaxim Pimenov <m@maps.me>2015-09-23 14:25:31 +0300
committerSergey Yershov <yershov@corp.mail.ru>2016-03-23 16:02:18 +0300
commit2166b6faf607d5283bf91b406bc499ac5fe911c2 (patch)
treea0ff6be6c56a158bdd04fdf159a0afeb4f123794 /indexer/feature_loader.cpp
parent7614d29e7b9781d46432ddf20fda22c2bf74f864 (diff)
[omim] Fix compilation of is_trivially_copyable in DDVector.
Diffstat (limited to 'indexer/feature_loader.cpp')
-rw-r--r--indexer/feature_loader.cpp38
1 files changed, 25 insertions, 13 deletions
diff --git a/indexer/feature_loader.cpp b/indexer/feature_loader.cpp
index 0e79af92bd..23c69645a1 100644
--- a/indexer/feature_loader.cpp
+++ b/indexer/feature_loader.cpp
@@ -1,17 +1,22 @@
#include "base/SRC_FIRST.hpp"
-#include "indexer/feature_loader.hpp"
+#include "indexer/classificator.hpp"
#include "indexer/feature.hpp"
-#include "indexer/scales.hpp"
+#include "indexer/feature_loader.hpp"
#include "indexer/geometry_serialization.hpp"
-#include "indexer/classificator.hpp"
+#include "indexer/scales.hpp"
#include "geometry/pointu_to_uint64.hpp"
#include "coding/byte_stream.hpp"
#include "coding/dd_vector.hpp"
+#include "base/assert.hpp"
#include "base/logging.hpp"
+
+#include "std/algorithm.hpp"
+#include "std/limits.hpp"
+
#include "defines.hpp"
namespace feature
@@ -256,18 +261,25 @@ void LoaderCurrent::ParseMetadata()
{
try
{
- typedef pair<uint32_t, uint32_t> IdxElementT;
- DDVector<IdxElementT, FilesContainerR::ReaderT> idx(m_Info.GetMetadataIndexReader());
-
- auto it = lower_bound(idx.begin(), idx.end()
- , make_pair(uint32_t(m_pF->m_id.m_index), uint32_t(0))
- , [](IdxElementT const & v1, IdxElementT const & v2) { return v1.first < v2.first; }
- );
-
- if (it != idx.end() && m_pF->m_id.m_index == it->first)
+ struct TMetadataIndexEntry
+ {
+ uint32_t key;
+ uint32_t value;
+ };
+ DDVector<TMetadataIndexEntry, FilesContainerR::ReaderT> idx(m_Info.GetMetadataIndexReader());
+
+ auto it = lower_bound(
+ idx.begin(), idx.end(),
+ TMetadataIndexEntry{static_cast<uint32_t>(m_pF->m_id.m_index), 0},
+ [](TMetadataIndexEntry const & v1, TMetadataIndexEntry const & v2)
+ {
+ return v1.key < v2.key;
+ });
+
+ if (it != idx.end() && m_pF->m_id.m_index == it->key)
{
ReaderSource<FilesContainerR::ReaderT> reader(m_Info.GetMetadataReader());
- reader.Skip(it->second);
+ reader.Skip(it->value);
m_pF->GetMetadata().DeserializeFromMWM(reader);
}
}