drop ported C++ functions

Remove the following C++ functions/methods, which have all been ported to Rust and no longer have any callers in C++:
common.cpp:
- assert_is_locked/ASSERT_IS_LOCKED

path.cpp:
- path_make_canonical

wutil.cpp:
- wreadlink
- fish_iswgraph
- file_id_t::older_than
This commit is contained in:
David Adam
2023-07-12 18:33:55 +08:00
parent 493cbeb84c
commit 0037e6e98d
6 changed files with 0 additions and 94 deletions

View File

@@ -384,27 +384,6 @@ dir_remoteness_t path_get_data_remoteness() { return get_data_directory().remote
dir_remoteness_t path_get_config_remoteness() { return get_config_directory().remoteness; }
void path_make_canonical(wcstring &path) {
// Ignore trailing slashes, unless it's the first character.
size_t len = path.size();
while (len > 1 && path.at(len - 1) == L'/') len--;
// Turn runs of slashes into a single slash.
size_t trailing = 0;
bool prev_was_slash = false;
for (size_t leading = 0; leading < len; leading++) {
wchar_t c = path.at(leading);
bool is_slash = (c == '/');
if (!prev_was_slash || !is_slash) {
// This is either the first slash in a run, or not a slash at all.
path.at(trailing++) = c;
}
prev_was_slash = is_slash;
}
assert(trailing <= len);
if (trailing < len) path.resize(trailing);
}
bool paths_are_equivalent(const wcstring &p1, const wcstring &p2) {
if (p1 == p2) return true;