forked from organicmaps/organicmaps
Review fix
This commit is contained in:
parent
86b5769fac
commit
6596abee0d
2 changed files with 11 additions and 5 deletions
|
@ -47,7 +47,10 @@ TrieIterator * MoveTrieIteratorToString(TrieIterator const & trieRoot,
|
|||
{
|
||||
bool bMatched = false;
|
||||
|
||||
for (uint32_t i = 0; i < pIter->m_edge.size(); ++i)
|
||||
ASSERT_LESS(pIter->m_edge.size(), std::numeric_limits<uint32_t>::max(), ());
|
||||
uint32_t const edgeCount = static_cast<uint32_t>(pIter->m_edge.size());
|
||||
|
||||
for (uint32_t i = 0; i < edgeCount; ++i)
|
||||
{
|
||||
size_t const szEdge = pIter->m_edge[i].m_str.size();
|
||||
|
||||
|
@ -159,10 +162,13 @@ void PrefixMatchInTrie(TrieIterator const & trieRoot,
|
|||
unique_ptr<search::TrieIterator> const pIter(trieQueue.back());
|
||||
trieQueue.pop_back();
|
||||
|
||||
for (size_t i = 0; i < pIter->m_value.size(); ++i)
|
||||
ASSERT_LESS(pIter->m_edge.size(), std::numeric_limits<uint32_t>::max(), ());
|
||||
uint32_t const edgeCount = static_cast<uint32_t>(pIter->m_edge.size());
|
||||
|
||||
for (uint32_t i = 0; i < edgeCount; ++i)
|
||||
f(pIter->m_value[i]);
|
||||
|
||||
for (uint32_t i = 0; i < pIter->m_edge.size(); ++i)
|
||||
for (uint32_t i = 0; i < edgeCount; ++i)
|
||||
trieQueue.push_back(pIter->GoToEdge(i));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ ParsedNumber::ParsedNumber(string const & number, bool american) : m_fullN(numbe
|
|||
size_t start = curr;
|
||||
try
|
||||
{
|
||||
int const x = stoi(number.substr(curr), &curr, 10);
|
||||
int const x = stoi(number.substr(start), &curr, 10);
|
||||
curr += start;
|
||||
m_endN = x;
|
||||
ASSERT_GREATER_OR_EQUAL(m_endN, 0, (number));
|
||||
|
@ -161,7 +161,7 @@ ParsedNumber::ParsedNumber(string const & number, bool american) : m_fullN(numbe
|
|||
}
|
||||
catch (exception & e)
|
||||
{
|
||||
// Expected case, we need to do nothig
|
||||
// Expected case - stoi haven't parsed anything.
|
||||
}
|
||||
}
|
||||
curr = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue