]> git.lizzy.rs Git - minetest.git/blobdiff - src/map.h
Optimize headers (part 2) (#6272)
[minetest.git] / src / map.h
index c3a1c1897dbc35d5594b140b888678c7aa12006b..93ab591a3c0184428a29a80c614d226ae1db7b75 100644 (file)
--- a/src/map.h
+++ b/src/map.h
@@ -17,8 +17,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifndef MAP_HEADER
-#define MAP_HEADER
+#pragma once
 
 #include <iostream>
 #include <sstream>
@@ -34,6 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "util/container.h"
 #include "nodetimer.h"
 #include "map_settings_manager.h"
+#include "debug.h"
 
 class Settings;
 class MapDatabase;
@@ -78,7 +78,7 @@ struct MapEditEvent
        std::set<v3s16> modified_blocks;
        u16 already_known_by_peer = 0;
 
-       MapEditEvent() {}
+       MapEditEvent() = default;
 
        MapEditEvent * clone()
        {
@@ -108,11 +108,7 @@ struct MapEditEvent
                case MEET_OTHER:
                {
                        VoxelArea a;
-                       for(std::set<v3s16>::iterator
-                                       i = modified_blocks.begin();
-                                       i != modified_blocks.end(); ++i)
-                       {
-                               v3s16 p = *i;
+                       for (v3s16 p : modified_blocks) {
                                v3s16 np1 = p*MAP_BLOCKSIZE;
                                v3s16 np2 = np1 + v3s16(1,1,1)*MAP_BLOCKSIZE - v3s16(1,1,1);
                                a.addPoint(np1);
@@ -217,8 +213,8 @@ class Map /*: public NodeContainer*/
        bool removeNodeWithEvent(v3s16 p);
 
        // Call these before and after saving of many blocks
-       virtual void beginSave() { return; }
-       virtual void endSave() { return; }
+       virtual void beginSave() {}
+       virtual void endSave() {}
 
        virtual void save(ModifiedState save_level) { FATAL_ERROR("FIXME"); }
 
@@ -525,5 +521,3 @@ class MMVManip : public VoxelManipulator
        */
        std::map<v3s16, u8> m_loaded_blocks;
 };
-
-#endif