Browse Source

Moving stl helper functions into inner namespace. Updating references in code. Removing an unused using declaration. (#2234)

pull/2238/head
lararennie 7 years ago
committed by GitHub
parent
commit
99be969847
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 8 deletions
  1. +1
    -3
      cpp/src/phonenumbers/geocoding/phonenumber_offline_geocoder.cc
  2. +2
    -1
      cpp/src/phonenumbers/phonenumberutil.cc
  3. +2
    -1
      cpp/src/phonenumbers/stl_util.h
  4. +1
    -3
      cpp/test/phonenumbers/regexp_adapter_test.cc

+ 1
- 3
cpp/src/phonenumbers/geocoding/phonenumber_offline_geocoder.cc View File

@ -17,7 +17,6 @@
#include "phonenumbers/geocoding/phonenumber_offline_geocoder.h"
#include <algorithm>
#include <map>
#include <string>
#include <unicode/unistr.h> // NOLINT(build/include_order)
@ -32,7 +31,6 @@ namespace i18n {
namespace phonenumbers {
using icu::UnicodeString;
using std::map;
using std::string;
namespace {
@ -77,7 +75,7 @@ void PhoneNumberOfflineGeocoder::Init(
}
PhoneNumberOfflineGeocoder::~PhoneNumberOfflineGeocoder() {
STLDeleteContainerPairSecondPointers(
gtl::STLDeleteContainerPairSecondPointers(
available_maps_.begin(), available_maps_.end());
}


+ 2
- 1
cpp/src/phonenumbers/phonenumberutil.cc View File

@ -51,6 +51,7 @@ namespace i18n {
namespace phonenumbers {
using google::protobuf::RepeatedField;
using gtl::OrderByFirst;
// static constants
const size_t PhoneNumberUtil::kMinLengthForNsn;
@ -808,7 +809,7 @@ PhoneNumberUtil::PhoneNumberUtil()
}
PhoneNumberUtil::~PhoneNumberUtil() {
STLDeleteContainerPairSecondPointers(
gtl::STLDeleteContainerPairSecondPointers(
country_calling_code_to_region_code_map_->begin(),
country_calling_code_to_region_code_map_->end());
}


+ 2
- 1
cpp/src/phonenumbers/stl_util.h View File

@ -18,6 +18,7 @@
namespace i18n {
namespace phonenumbers {
namespace gtl {
// Compares the first attribute of two pairs.
struct OrderByFirst {
template <typename T>
@ -44,7 +45,7 @@ void STLDeleteElements(T* container) {
delete *it;
}
}
} // namespace gtl
} // namespace phonenumbers
} // namespace i18n


+ 1
- 3
cpp/test/phonenumbers/regexp_adapter_test.cc View File

@ -69,9 +69,7 @@ class RegExpAdapterTest : public testing::Test {
#endif // I18N_PHONENUMBERS_USE_RE2
}
~RegExpAdapterTest() {
STLDeleteElements(&contexts_);
}
~RegExpAdapterTest() { gtl::STLDeleteElements(&contexts_); }
static string ErrorMessage(const RegExpTestContext& context) {
return StrCat("Test failed with ", context.name, " implementation.");


Loading…
Cancel
Save