summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-04-19 00:36:30 +0200
committerGitHub <noreply@github.com>2017-04-19 00:36:30 +0200
commitcf37a5569002e83cc4d6916b39118ceba134da1b (patch)
tree4de13e55c8f2b37fca85f4c9a4b15e52bc0f030a /src/map.cpp
parent5f2af7c4e80da1c646e5a19ceed5bd0871b56e85 (diff)
downloadminetest-cf37a5569002e83cc4d6916b39118ceba134da1b.tar.gz
minetest-cf37a5569002e83cc4d6916b39118ceba134da1b.tar.bz2
minetest-cf37a5569002e83cc4d6916b39118ceba134da1b.zip
Fix various variables passed by copy instead of const ref (#5610)
Pointed by cppcheck
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp7
1 files changed, 4 insertions, 3 deletions
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 &sectordir, const std::string &blockfile)
{
v2s16 p2d = getSectorPos(sectordir);