From c738d1eeabbbe9164a25f6b69bc7ec1a3b44b051 Mon Sep 17 00:00:00 2001 From: Loïc Blot Date: Thu, 17 Aug 2017 20:23:54 +0200 Subject: clientobject, clouds, collision, clientsimpleobject: code modernization (#6260) * clientobject, clouds, collision, clientsimpleobject: code modernization * use range-based for loops * simplify some tests * various code style fixes * use emplace_back instead of push_back when necessary * use auto on some iterators * use default operator when needed * unroll v3s16 creation on collisionMoveSimple --- src/clientobject.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/clientobject.cpp') diff --git a/src/clientobject.cpp b/src/clientobject.cpp index 329f10469..f4b69201b 100644 --- a/src/clientobject.cpp +++ b/src/clientobject.cpp @@ -42,7 +42,7 @@ ClientActiveObject* ClientActiveObject::create(ActiveObjectType type, Client *client, ClientEnvironment *env) { // Find factory function - std::unordered_map::iterator n = m_types.find(type); + auto n = m_types.find(type); if (n == m_types.end()) { // If factory is not found, just return. warningstream << "ClientActiveObject: No factory for type=" @@ -57,8 +57,8 @@ ClientActiveObject* ClientActiveObject::create(ActiveObjectType type, void ClientActiveObject::registerType(u16 type, Factory f) { - std::unordered_map::iterator n = m_types.find(type); - if(n != m_types.end()) + auto n = m_types.find(type); + if (n != m_types.end()) return; m_types[type] = f; } -- cgit v1.2.3