diff options
author | Lev Dragunov <l.dragunov@corp.mail.ru> | 2015-03-26 16:18:12 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:45:08 +0300 |
commit | 7b25ea711fe6b3782cdaa2481d0f67295004f2a9 (patch) | |
tree | 2ba141626f74e9f49cdaf833e1dbf9ef48caeb29 /3party/osrm | |
parent | b5283c6958001fb39d1c894d26f0eab79534bc40 (diff) |
Code beatifying
Diffstat (limited to '3party/osrm')
-rw-r--r-- | 3party/osrm/osrm-backend/Plugins/MapsMePlugin.h | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/3party/osrm/osrm-backend/Plugins/MapsMePlugin.h b/3party/osrm/osrm-backend/Plugins/MapsMePlugin.h index 187be39e25..2c8ae2d7c5 100644 --- a/3party/osrm/osrm-backend/Plugins/MapsMePlugin.h +++ b/3party/osrm/osrm-backend/Plugins/MapsMePlugin.h @@ -11,8 +11,6 @@ #include "../Util/StringUtil.h" #include "../Util/TimingUtil.h" -#include <cstdlib> - #include <algorithm> #include <memory> #include <unordered_map> @@ -48,17 +46,16 @@ template <class DataFacadeT> class MapsMePlugin final : public BasePlugin /// @return false If point is in country. bool operator() (size_t id) { - - std::vector<m2::RegionD> const & rgnV = m_regions[id]; - for (size_t i = 0; i < rgnV.size(); ++i) - { - if (rgnV[i].Contains(m_pt)) + auto it = find_if(m_regions[id].begin(), m_regions[id].end(), + [&](m2::RegionD const & region) { - m_res = id; - return false; - } - } - return true; + if (region.Contains(m_pt)) + { + m_res = id; + return true; + } + }); + return it == m_regions[id].end(); } }; |