mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-10 05:32:18 -06:00
Remove unused function
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user