Review notes

This commit is contained in:
LaGrunge 2019-10-29 02:25:38 +03:00 committed by cc-engineering
parent 407531c1b7
commit 7b61ba4bb0
2 changed files with 6 additions and 6 deletions

View file

@ -3,11 +3,9 @@
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
#include "3party/cttrie/cttrie.h"
#pragma clang diagnostic pop
#pragma clang diagnostic pop
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"

View file

@ -34,14 +34,16 @@ std::string DebugPrint(OsmElement::EntityType type)
// trim from start (in place)
static inline void ltrim(std::string &s) {
s.erase(s.begin(), std::find_if(s.begin(), s.end(),
std::not1(std::ptr_fun<int, int>(std::isspace))));
s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int ch) {
return !std::isspace(ch);
}));
}
// trim from end (in place)
static inline void rtrim(std::string &s) {
s.erase(std::find_if(s.rbegin(), s.rend(),
std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) {
return !std::isspace(ch);
}).base(), s.end());
}
// trim from both ends (in place)