summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-04-20 00:12:52 +0200
committerGitHub <noreply@github.com>2017-04-20 00:12:52 +0200
commitf98bbe193e0093aca8d8957cec82fdbd28639915 (patch)
tree19879fbca595d4e8cddfa8d7d069b7f78016a713 /src/map.cpp
parentf3fe62a0bf9e775b3e6e838f104ab605a2238792 (diff)
downloadminetest-f98bbe193e0093aca8d8957cec82fdbd28639915.tar.gz
minetest-f98bbe193e0093aca8d8957cec82fdbd28639915.tar.bz2
minetest-f98bbe193e0093aca8d8957cec82fdbd28639915.zip
Fix various copy instead of const ref reported by cppcheck (part 3) (#5616)
* Also remove 2 non declared but defined functions * Make some functions around const ref changes const
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 3da96e77b..f8bbee180 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -2347,16 +2347,15 @@ bool ServerMap::saveBlock(MapBlock *block, Database *db)
return ret;
}
-void ServerMap::loadBlock(std::string sectordir, std::string blockfile,
+void ServerMap::loadBlock(const std::string &sectordir, const std::string &blockfile,
MapSector *sector, bool save_after_load)
{
DSTACK(FUNCTION_NAME);
std::string fullpath = sectordir + DIR_DELIM + blockfile;
try {
-
std::ifstream is(fullpath.c_str(), std::ios_base::binary);
- if(is.good() == false)
+ if (!is.good())
throw FileNotGoodException("Cannot open block file");
v3s16 p3d = getBlockPos(sectordir, blockfile);