From 02a83e4cdb29bdcce6cfcb7080c45692a1ffeede Mon Sep 17 00:00:00 2001 From: Sergey Yershov Date: Wed, 27 May 2015 11:41:02 +0300 Subject: [PATCH] Review fixes --- generator/osm_o5m_source.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/generator/osm_o5m_source.hpp b/generator/osm_o5m_source.hpp index ec29bb6da2..12ae52a2ec 100644 --- a/generator/osm_o5m_source.hpp +++ b/generator/osm_o5m_source.hpp @@ -156,6 +156,8 @@ protected: struct StringTableRecord { + // This important value got from documentation on O5M format + // If change it all will be broken enum { MaxEntrySize = 252 }; char key[MaxEntrySize]; @@ -409,10 +411,10 @@ public: { memmove(m_stringTable[m_stringCurrentIndex].key, m_stringBuffer.data(), sizes[0]); memmove(m_stringTable[m_stringCurrentIndex].value, m_stringBuffer.data() + sizes[0], sizes[1]); - size_t const key = m_stringCurrentIndex++; - m_stringCurrentIndex = (m_stringCurrentIndex == m_stringTable.size()) ? 0 : m_stringCurrentIndex; if (kv) - *kv = KeyValue(m_stringTable[key].key, m_stringTable[key].value); + *kv = KeyValue(m_stringTable[m_stringCurrentIndex].key, m_stringTable[m_stringCurrentIndex].value); + if (++m_stringCurrentIndex == m_stringTable.size()) + m_stringCurrentIndex = 0; return this; }