MCPcopy Create free account
hub / github.com/comaps/comaps / clean_code_chars

Function clean_code_chars

3party/open-location-code/openlocationcode.cc:108–118  ·  view source on GitHub ↗

Remove the separator and padding characters from the code.

Source from the content-addressed store, hash-verified

106
107// Remove the separator and padding characters from the code.
108std::string clean_code_chars(const std::string &code) {
109 std::string clean_code(code);
110 clean_code.erase(
111 std::remove(clean_code.begin(), clean_code.end(), internal::kSeparator),
112 clean_code.end());
113 if (clean_code.find(internal::kPaddingCharacter)) {
114 clean_code =
115 clean_code.substr(0, clean_code.find(internal::kPaddingCharacter));
116 }
117 return clean_code;
118}
119
120} // anonymous namespace
121

Callers 2

DecodeFunction · 0.85
CodeLengthFunction · 0.85

Calls 4

eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected