From 55ab4264dc3f42a4588de0cf52e8f0f88e4fd90e Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Fri, 18 Aug 2017 07:44:42 +0200 Subject: Modernize various files * range-based for loops * emplace_back instead of push_back * code style * C++ headers instead of C headers * Default operators * empty stl function --- src/guiscalingfilter.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/guiscalingfilter.cpp') diff --git a/src/guiscalingfilter.cpp b/src/guiscalingfilter.cpp index 1b0dfac79..dc6219b60 100644 --- a/src/guiscalingfilter.cpp +++ b/src/guiscalingfilter.cpp @@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "imagefilters.h" #include "settings.h" #include "util/numeric.h" -#include +#include #include "client/renderingengine.h" /* Maintain a static cache to store the images that correspond to textures @@ -51,16 +51,14 @@ void guiScalingCache(io::path key, video::IVideoDriver *driver, video::IImage *v // Manually clear the cache, e.g. when switching to different worlds. void guiScalingCacheClear() { - for (std::map::iterator it = g_imgCache.begin(); - it != g_imgCache.end(); ++it) { - if (it->second) - it->second->drop(); + for (auto &it : g_imgCache) { + if (it.second) + it.second->drop(); } g_imgCache.clear(); - for (std::map::iterator it = g_txrCache.begin(); - it != g_txrCache.end(); ++it) { - if (it->second) - RenderingEngine::get_video_driver()->removeTexture(it->second); + for (auto &it : g_txrCache) { + if (it.second) + RenderingEngine::get_video_driver()->removeTexture(it.second); } g_txrCache.clear(); } -- cgit v1.2.3