Move many loops over glcr::Vector to range-based loops.

This commit is contained in:
Drew Galbraith 2024-01-11 17:13:35 -08:00
parent c06d1741f3
commit b2354ae341
7 changed files with 18 additions and 19 deletions

View file

@ -37,6 +37,7 @@ class Vector {
// Setters.
// FIXME: Handle downsizing.
// TODO: Rename this so it is clear that this only affects capacity.
void Resize(uint64_t capacity);
void PushBack(const T& item);

View file

@ -72,8 +72,8 @@ glcr::ErrorOr<glcr::Vector<glcr::String>> ListDirectory(glcr::StringView path) {
auto file_views = glcr::StrSplit(dir.filenames(), ',');
glcr::Vector<glcr::String> files;
for (uint64_t i = 0; i < file_views.size(); i++) {
files.PushBack(file_views[i]);
for (const auto& view : glcr::StrSplit(dir.filenames(), ',')) {
files.PushBack(view);
}
return files;
}