Skip to content

Commit

Permalink
GUI2: praise auto
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Oct 19, 2019
1 parent 97acce2 commit b0d18af
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/gui/core/canvas.cpp
Expand Up @@ -34,8 +34,6 @@
#include "video.hpp"
#include "wml_exception.hpp"

#include <iterator>

namespace gui2
{

Expand Down
8 changes: 2 additions & 6 deletions src/gui/core/event/distributor.cpp
Expand Up @@ -671,8 +671,7 @@ void distributor::keyboard_add_to_chain(widget* widget)
void distributor::keyboard_remove_from_chain(widget* w)
{
assert(w);
std::vector<widget*>::iterator itor = std::find(
keyboard_focus_chain_.begin(), keyboard_focus_chain_.end(), w);
auto itor = std::find(keyboard_focus_chain_.begin(), keyboard_focus_chain_.end(), w);

if(itor != keyboard_focus_chain_.end()) {
keyboard_focus_chain_.erase(itor);
Expand Down Expand Up @@ -803,10 +802,7 @@ void distributor::signal_handler_notify_removal(dispatcher& w,
if(keyboard_focus_ == &w) {
keyboard_focus_ = nullptr;
}
const std::vector<widget*>::iterator itor
= std::find(keyboard_focus_chain_.begin(),
keyboard_focus_chain_.end(),
&w);
const auto itor = std::find(keyboard_focus_chain_.begin(), keyboard_focus_chain_.end(), &w);
if(itor != keyboard_focus_chain_.end()) {
keyboard_focus_chain_.erase(itor);
}
Expand Down
3 changes: 1 addition & 2 deletions src/gui/core/notifier.hpp
Expand Up @@ -75,8 +75,7 @@ class notifier
*/
void disconnect_notifiee(notifiee<functor_t>& target)
{
typename std::map<notifiee<functor_t>*, functor_t>::iterator itor
= notifiees_.find(&target);
auto itor = notifiees_.find(&target);

if(itor != notifiees_.end()) {

Expand Down
2 changes: 1 addition & 1 deletion src/gui/core/timer.cpp
Expand Up @@ -205,7 +205,7 @@ bool execute_timer(const std::size_t id)
{
std::lock_guard<std::mutex> lock(timers_mutex);

std::map<size_t, timer>::iterator itor = get_timers().find(id);
auto itor = get_timers().find(id);
if(itor == get_timers().end()) {
LOG_GUI_E << "Can't execute timer since it no longer exists.\n";
return false;
Expand Down

0 comments on commit b0d18af

Please sign in to comment.