diff options
author | Sergey Magidovich <mgsergio@mapswithme.com> | 2016-05-24 12:50:41 +0300 |
---|---|---|
committer | Sergey Magidovich <mgsergio@mapswithme.com> | 2016-05-25 14:22:58 +0300 |
commit | ec26af0c03be006e89729b7f8cd84a675372cfc2 (patch) | |
tree | 0f596570beb2ecd23fecd5d5d65eaf44340865c9 /indexer/postcodes_matcher.cpp | |
parent | 6c3124edee85535e6baa7259e810a3dabd2d39e8 (diff) |
Code review.
Diffstat (limited to 'indexer/postcodes_matcher.cpp')
-rw-r--r-- | indexer/postcodes_matcher.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/indexer/postcodes_matcher.cpp b/indexer/postcodes_matcher.cpp index 9c7889d793..143b462216 100644 --- a/indexer/postcodes_matcher.cpp +++ b/indexer/postcodes_matcher.cpp @@ -102,7 +102,7 @@ public: // patterns. // // Complexity: O(total length of tokens in |slice|). - bool HasString(StringSliceBase const & slice, bool handleAsPrefix) const + bool HasString(StringSliceBase const & slice, bool isPrefix) const { if (slice.Size() == 0) return m_root.m_isLeaf; @@ -120,7 +120,7 @@ public: if (!cur) return false; - if (handleAsPrefix) + if (isPrefix) return true; return cur->m_isLeaf; @@ -159,18 +159,18 @@ PostcodesMatcher const & GetPostcodesMatcher() } } // namespace -bool LooksLikePostcode(StringSliceBase const & slice, bool handleAsPrefix) +bool LooksLikePostcode(StringSliceBase const & slice, bool isPrefix) { - return GetPostcodesMatcher().HasString(slice, handleAsPrefix); + return GetPostcodesMatcher().HasString(slice, isPrefix); } -bool LooksLikePostcode(string const & s, bool handleAsPrefix) +bool LooksLikePostcode(string const & s, bool isPrefix) { vector<UniString> tokens; bool const lastTokenIsPrefix = TokenizeStringAndCheckIfLastTokenIsPrefix(s, tokens, search::Delimiters()); - return LooksLikePostcode(NoPrefixStringSlice(tokens), handleAsPrefix && lastTokenIsPrefix); + return LooksLikePostcode(NoPrefixStringSlice(tokens), isPrefix && lastTokenIsPrefix); } size_t GetMaxNumTokensInPostcode() { return GetPostcodesMatcher().GetMaxNumTokensInPostcode(); } |