/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
partners_api/taxi_places.cpp
34 строки
936 B
Maxim Pimenov
[storage] Removed the T prefix from type aliases and type names.
13 фев 2019, 14:58
13 фев 2019, 14:58
b1bec1c
Код
Авторство
О чём код?
#include "partners_api/taxi_places.hpp" #include <algorithm> namespace taxi { bool Places::IsCountriesEmpty() const { return m_countries.empty(); } bool Places::IsMwmsEmpty() const { return m_mwmIds.empty(); } bool Places::Has(storage::CountryId const & id, std::string const & city) const { auto const countryIt = std::find_if(m_countries.cbegin(), m_countries.cend(), [&id](Country const & country) { return country.m_id == id; }); if (countryIt == m_countries.cend()) return false; auto const & cities = countryIt->m_cities; if (cities.empty()) return true; auto const cityIt = std::find_if(cities.cbegin(), cities.cend(), [&city](std::string const & c) { return c == city; }); return cityIt != cities.cend(); } bool Places::Has(storage::CountryId const & mwmId) const { return m_mwmIds.find(mwmId) != m_mwmIds.cend(); } } // namespace taxi