Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
idealvin committed Nov 3, 2023
1 parent c0d8f9c commit 51990df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/fastring.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand All @@ -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;
Expand All @@ -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':
Expand All @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/fs_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 51990df

Please sign in to comment.