Skip to content

Commit 930df41

Browse files
authored
Merge pull request #181 from viettaml/patch-1
Remove use of std::begin() and std::end()
2 parents bd54569 + fa32ed1 commit 930df41

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cpp/openlocationcode.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,10 @@ bool IsValid(const std::string &code) {
405405
return false;
406406
}
407407
// Are there any invalid characters?
408+
const char* end = internal::kAlphabet + internal::kEncodingBase;
408409
for (char c : code) {
409410
if (c != internal::kSeparator && c != internal::kPaddingCharacter &&
410-
std::find(std::begin(internal::kAlphabet),
411-
std::end(internal::kAlphabet),
412-
(char)toupper(c)) == std::end(internal::kAlphabet)) {
411+
std::find(internal::kAlphabet, end, (char)toupper(c)) == end) {
413412
return false;
414413
}
415414
}

0 commit comments

Comments
 (0)