Replace duplicated code with template

This commit is contained in:
Erica Fischer
2024-11-01 09:55:02 -07:00
parent 1afe80d31a
commit 0123e9bde1
5 changed files with 49 additions and 137 deletions
+5 -1
View File
@@ -98,7 +98,11 @@ struct mvt_value {
} numeric_value;
std::string get_string_value() const {
return std::string(*s, numeric_value.string_value.off, numeric_value.string_value.len);
if (type == mvt_string) {
return std::string(*s, numeric_value.string_value.off, numeric_value.string_value.len);
} else {
return toString();
}
}
std::string_view get_string_view() const {