Kernel: Remove unnecessary reverse from VFS file search
This commit is contained in:
parent
3bf57e0748
commit
71a2d0971f
|
@ -200,11 +200,11 @@ namespace Kernel
|
||||||
[&path_parts](BAN::StringView path) -> BAN::ErrorOr<void>
|
[&path_parts](BAN::StringView path) -> BAN::ErrorOr<void>
|
||||||
{
|
{
|
||||||
auto split_path = TRY(path.split('/'));
|
auto split_path = TRY(path.split('/'));
|
||||||
split_path.reverse();
|
TRY(path_parts.reserve(path_parts.size() + split_path.size()));
|
||||||
for (auto part : split_path)
|
for (size_t i = split_path.size(); i > 0; i--)
|
||||||
{
|
{
|
||||||
TRY(path_parts.emplace_back());
|
TRY(path_parts.emplace_back());
|
||||||
TRY(path_parts.back().append(part));
|
TRY(path_parts.back().append(split_path[i - 1]));
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue