We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bd54569 + fa32ed1 commit 930df41Copy full SHA for 930df41
cpp/openlocationcode.cc
@@ -405,11 +405,10 @@ bool IsValid(const std::string &code) {
405
return false;
406
}
407
// Are there any invalid characters?
408
+ const char* end = internal::kAlphabet + internal::kEncodingBase;
409
for (char c : code) {
410
if (c != internal::kSeparator && c != internal::kPaddingCharacter &&
- std::find(std::begin(internal::kAlphabet),
411
- std::end(internal::kAlphabet),
412
- (char)toupper(c)) == std::end(internal::kAlphabet)) {
+ std::find(internal::kAlphabet, end, (char)toupper(c)) == end) {
413
414
415
0 commit comments