From cf37a5569002e83cc4d6916b39118ceba134da1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Wed, 19 Apr 2017 00:36:30 +0200 Subject: Fix various variables passed by copy instead of const ref (#5610) Pointed by cppcheck --- src/map.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index b690ea3b3..3da96e77b 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1226,7 +1226,8 @@ bool Map::isBlockOccluded(MapBlock *block, v3s16 cam_pos_nodes) { /* ServerMap */ -ServerMap::ServerMap(std::string savedir, IGameDef *gamedef, EmergeManager *emerge): +ServerMap::ServerMap(const std::string &savedir, IGameDef *gamedef, + EmergeManager *emerge): Map(dout_server, gamedef), settings_mgr(g_settings, savedir + DIR_DELIM + "map_meta.txt"), m_emerge(emerge), @@ -1936,7 +1937,7 @@ std::string ServerMap::getSectorDir(v2s16 pos, int layout) } } -v2s16 ServerMap::getSectorPos(std::string dirname) +v2s16 ServerMap::getSectorPos(const std::string &dirname) { unsigned int x = 0, y = 0; int r; @@ -1966,7 +1967,7 @@ v2s16 ServerMap::getSectorPos(std::string dirname) return pos; } -v3s16 ServerMap::getBlockPos(std::string sectordir, std::string blockfile) +v3s16 ServerMap::getBlockPos(const std::string §ordir, const std::string &blockfile) { v2s16 p2d = getSectorPos(sectordir); -- cgit v1.2.3