diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2018-05-07 12:49:44 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2018-05-07 18:03:39 +0300 |
commit | d0a762cbaa11f1a312f421d60979877e69f40687 (patch) | |
tree | abdab9312965a000b96c8e59728e0f990400bc29 /partners_api | |
parent | d0faaca2eaad4463f5e9bd68e9345a7e1e1e998d (diff) |
Review fixes
Diffstat (limited to 'partners_api')
-rw-r--r-- | partners_api/mopub_ads.cpp | 4 | ||||
-rw-r--r-- | partners_api/partners.cpp | 7 | ||||
-rw-r--r-- | partners_api/partners.hpp | 4 |
3 files changed, 10 insertions, 5 deletions
diff --git a/partners_api/mopub_ads.cpp b/partners_api/mopub_ads.cpp index 41bbdf3e95..b629eedac7 100644 --- a/partners_api/mopub_ads.cpp +++ b/partners_api/mopub_ads.cpp @@ -71,9 +71,9 @@ Mopub::Mopub() AppendEntry({{"sponsored", "banner"}}, kSponsoredBannerPlacementId); - for (auto const & p : kPartners) + for (auto const & p : GetPartners()) { - auto const placementId = p.GetBannerPlacementId(); + auto const & placementId = p.GetBannerPlacementId(); if (!placementId.empty()) AppendEntry({{"sponsored", p.m_type.c_str()}}, placementId); } diff --git a/partners_api/partners.cpp b/partners_api/partners.cpp index 4a00ae08f7..ab87596e3c 100644 --- a/partners_api/partners.cpp +++ b/partners_api/partners.cpp @@ -46,7 +46,7 @@ PartnerInfo::PartnerInfo(int partnerIndex, std::string && name) : PartnerInfo(partnerIndex, std::move(name), false /* hasButton */) {} -std::string PartnerInfo::GetBannerPlacementId() const +std::string const & PartnerInfo::GetBannerPlacementId() const { #if defined(OMIM_OS_IPHONE) return m_iosBannerPlacementId; @@ -77,6 +77,11 @@ int PartnerChecker::GetPartnerIndex(FeatureType const & ft) const return kFakePartnerIndex; } +std::vector<PartnerInfo> const & GetPartners() +{ + return kPartners; +} + PartnerInfo const & GetPartnerByIndex(int partnerIndex) { auto const it = std::find_if(kPartners.cbegin(), kPartners.cend(), diff --git a/partners_api/partners.hpp b/partners_api/partners.hpp index 20c14eadbc..a0c367e0b6 100644 --- a/partners_api/partners.hpp +++ b/partners_api/partners.hpp @@ -20,7 +20,7 @@ struct PartnerInfo PartnerInfo(int partnerIndex, std::string && name); - std::string GetBannerPlacementId() const; + std::string const & GetBannerPlacementId() const; }; class PartnerChecker : public ftypes::BaseChecker @@ -34,6 +34,6 @@ public: DECLARE_CHECKER_INSTANCE(PartnerChecker); }; -extern std::vector<PartnerInfo> const kPartners; +extern std::vector<PartnerInfo> const & GetPartners(); extern PartnerInfo const & GetPartnerByIndex(int partnerIndex); |