Skip to content

Commit

Permalink
GUI2/Grid: made use of std::exchange
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Oct 19, 2019
1 parent c15cb06 commit 4a5d34d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/gui/widgets/grid.hpp
Expand Up @@ -409,10 +409,7 @@ class grid : public widget
*/
std::unique_ptr<widget> free_widget()
{
std::unique_ptr<widget> temp(nullptr);
widget_.swap(temp);

return temp;
return std::exchange(widget_, nullptr);
}

private:
Expand Down

0 comments on commit 4a5d34d

Please sign in to comment.