Kernel: Remove unnecessary reverse from VFS file search

This commit is contained in:
Bananymous 2024-12-07 01:41:23 +02:00
parent 3bf57e0748
commit 71a2d0971f
1 changed files with 3 additions and 3 deletions

View File

@ -200,11 +200,11 @@ namespace Kernel
[&path_parts](BAN::StringView path) -> BAN::ErrorOr<void>
{
auto split_path = TRY(path.split('/'));
split_path.reverse();
for (auto part : split_path)
TRY(path_parts.reserve(path_parts.size() + split_path.size()));
for (size_t i = split_path.size(); i > 0; i--)
{
TRY(path_parts.emplace_back());
TRY(path_parts.back().append(part));
TRY(path_parts.back().append(split_path[i - 1]));
}
return {};
};