1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 07:07:44 +00:00

Userland: Use File::lines() range-based for loop where appropriate

This commit is contained in:
Sahan Fernando 2021-12-08 10:56:50 +11:00 committed by Ali Mohammad Pur
parent 2c43eaa50c
commit 49ed168ced
2 changed files with 2 additions and 5 deletions

View file

@ -20,9 +20,7 @@ RefPtr<Mesh> WavefrontOBJLoader::load(Core::File& file)
dbgln("Wavefront: Loading {}...", file.name());
// Start reading file line by line
for (auto line = file.line_begin(); !line.at_end(); ++line) {
auto object_line = *line;
for (auto object_line : file.lines()) {
// Ignore file comments
if (object_line.starts_with("#"))
continue;

View file

@ -228,8 +228,7 @@ Result<Vector<Color>, String> PaletteWidget::load_palette_file(Core::File& file)
{
Vector<Color> palette;
while (file.can_read_line()) {
auto line = file.read_line();
for (auto line : file.lines()) {
if (line.is_whitespace())
continue;