Skip to content

Commit

Permalink
Minor cleanup to 6110fb5
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Aug 9, 2017
1 parent 7b85d7b commit 9c15e54
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/gui/core/canvas.cpp
Expand Up @@ -1494,16 +1494,12 @@ void canvas::parse_cfg(const config& cfg)

void canvas::clear_shapes(const bool force)
{
auto iter = std::remove_if(shapes_.begin(), shapes_.end(), [force](const shape_ptr s)
{
return !s->immutable() && !force;
});
auto conditional = [force](const shape_ptr s)->bool { return !s->immutable() && !force; };

auto iter = std::remove_if(shapes_.begin(), shapes_.end(), conditional);
shapes_.erase(iter, shapes_.end());

iter = std::remove_if(drawn_shapes_.begin(), drawn_shapes_.end(), [force](const shape_ptr s)
{
return !s->immutable() && !force;
});
iter = std::remove_if(drawn_shapes_.begin(), drawn_shapes_.end(), conditional);
drawn_shapes_.erase(iter, drawn_shapes_.end());
}

Expand Down

1 comment on commit 9c15e54

@CelticMinstrel
Copy link
Member

@CelticMinstrel CelticMinstrel commented on 9c15e54 Aug 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mildly prefer the old version to this so-called cleanup.

Please sign in to comment.