diff --git a/src/benchmark.cc b/src/benchmark.cc index ac5e9a2b7..fac0cae5d 100644 --- a/src/benchmark.cc +++ b/src/benchmark.cc @@ -102,7 +102,7 @@ void print_results(Group& g) { p = t.size() <= 7 ? 9 - t.size() : 2; cout << "| " << text::yellow(t) << fastring(p, ' ') << "|\n"; } -} +} } // xx diff --git a/src/fastring.cc b/src/fastring.cc index 9aebfd659..d423e7f22 100644 --- a/src/fastring.cc +++ b/src/fastring.cc @@ -155,7 +155,7 @@ fastring& fastring::trim(char c, char d) { case 'R': e = _size; while (e > 0 && _p[e - 1] == c) --e; - e != _size ? (void)(_size = e) : (void)0; + if (e != _size) _size = e; break; case 'l': case 'L': @@ -166,7 +166,7 @@ fastring& fastring::trim(char c, char d) { default: b = 0, e = _size; while (e > 0 && _p[e - 1] == c) --e; - e != _size ? (void)(_size = e) : (void)0; + if (e != _size) _size = e; while (b < _size && _p[b] == c) ++b; if (b != 0 && (_size -= b) != 0) memmove(_p, _p + b, _size); break; @@ -190,7 +190,7 @@ fastring& fastring::trim(const char* x, char d) { case 'R': e = _size; while (e > 0 && bs[p[e - 1]]) --e; - e != _size ? (void)(_size = e) : (void)0; + if (e != _size) _size = e; break; case 'l': case 'L': @@ -201,7 +201,7 @@ fastring& fastring::trim(const char* x, char d) { default: b = 0, e = _size; while (e > 0 && bs[p[e - 1]]) --e; - e != _size ? (void)(_size = e) : (void)0; + if (e != _size) _size = e; while (b < _size && bs[p[b]]) ++b; if (b != 0 && (_size -= b) != 0) memmove(_p, _p + b, _size); break; diff --git a/src/fs_win.cc b/src/fs_win.cc index a5772fbbf..c055f334b 100644 --- a/src/fs_win.cc +++ b/src/fs_win.cc @@ -151,9 +151,8 @@ inline bool is_dot_or_dotdot(const wchar_t* p) { } static bool _rmdir(fastring& s, wchar_t c) { - const wchar_t* t = L"*"; const size_t n = s.size(); - pathcat(s, c, t); + pathcat(s, c, L"*"); WIN32_FIND_DATAW e; HANDLE h = FindFirstFileW((PWC)s.data(), &e);