mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
Upgrade limonp to v0.5.6 to fix hidden trouble.
This commit is contained in:
parent
643148edf5
commit
92fdf009cb
@ -1,5 +1,9 @@
|
|||||||
# CppJieba ChangeLog
|
# CppJieba ChangeLog
|
||||||
|
|
||||||
|
## next version
|
||||||
|
|
||||||
|
+ Upgrade limonp to v0.5.6 to fix hidden trouble.
|
||||||
|
|
||||||
## v4.5.1
|
## v4.5.1
|
||||||
|
|
||||||
+ Upgrade limonp to v0.5.5 to solve macro name conficts in some special case.
|
+ Upgrade limonp to v0.5.5 to solve macro name conficts in some special case.
|
||||||
|
9
deps/limonp/StringUtil.hpp
vendored
9
deps/limonp/StringUtil.hpp
vendored
@ -78,13 +78,18 @@ inline string& Lower(string& str) {
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline bool IsSpace(unsigned c) {
|
||||||
|
// when passing large int as the argument of isspace, it core dump, so here need a type cast.
|
||||||
|
return c > 0xff ? false : std::isspace(c & 0xff);
|
||||||
|
}
|
||||||
|
|
||||||
inline std::string& LTrim(std::string &s) {
|
inline std::string& 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(), std::not1(std::ptr_fun<unsigned, bool>(IsSpace))));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::string& RTrim(std::string &s) {
|
inline std::string& 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(), std::not1(std::ptr_fun<unsigned, bool>(IsSpace))).base(), s.end());
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user