Remove unused function

This commit is contained in:
Malin E
2022-03-25 16:46:21 +01:00
parent 45ed5b6e69
commit bff86e7185

View File

@@ -62,51 +62,6 @@ namespace {
constexpr const char* Years = "calendar years";
constexpr const char* Unitless = "equal intervals (unitless)";
std::string trim(const std::string& text) {
std::string result = text;
if (text.empty())
return "";
// front
while (result.front() == ' ') {
result = result.substr(1);
}
// end
while (result.back() == ' ') {
result = result.substr(0, result.length() - 1);
}
// middle
int offset = 0;
int start = -1;
int step = 1;
// Find start of gap
while ((start = result.find_first_of(' ', offset)) != std::string::npos) {
// Widen gap
while (result[start + step] == ' ') {
++step;
}
// Measure gap, if big then erase it
if (step > 1) {
result = result.erase(start, step);
// Add one whitespace for readability
result = result.insert(start, " | ");
step = 1;
offset = start;
}
// Keep looking
offset = start + step;
step = 1;
}
return result;
}
int findId(const std::string& match) {
// Format: id, other information...
std::stringstream str(match);