mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:27:34 +00:00
Userland: Use File::lines() range-based for loop where appropriate
This commit is contained in:
parent
2c43eaa50c
commit
49ed168ced
2 changed files with 2 additions and 5 deletions
|
@ -20,9 +20,7 @@ RefPtr<Mesh> WavefrontOBJLoader::load(Core::File& file)
|
||||||
dbgln("Wavefront: Loading {}...", file.name());
|
dbgln("Wavefront: Loading {}...", file.name());
|
||||||
|
|
||||||
// Start reading file line by line
|
// Start reading file line by line
|
||||||
for (auto line = file.line_begin(); !line.at_end(); ++line) {
|
for (auto object_line : file.lines()) {
|
||||||
auto object_line = *line;
|
|
||||||
|
|
||||||
// Ignore file comments
|
// Ignore file comments
|
||||||
if (object_line.starts_with("#"))
|
if (object_line.starts_with("#"))
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -228,8 +228,7 @@ Result<Vector<Color>, String> PaletteWidget::load_palette_file(Core::File& file)
|
||||||
{
|
{
|
||||||
Vector<Color> palette;
|
Vector<Color> palette;
|
||||||
|
|
||||||
while (file.can_read_line()) {
|
for (auto line : file.lines()) {
|
||||||
auto line = file.read_line();
|
|
||||||
if (line.is_whitespace())
|
if (line.is_whitespace())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue