aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgregorycu <gregory.currie@gmail.com>2016-03-31 01:07:47 +1100
committerkwolekr <kwolekr@minetest.net>2016-03-30 11:38:42 -0400
commitf9a90383e14a02ab0e66e5d5c36940a4ffb54502 (patch)
tree35ef6b42d202bf61f5eff0a5cf2ff0cb018edf4c /src
parente082c7766afd2be8bf55b47e261544f7191bd0ed (diff)
downloadminetest-f9a90383e14a02ab0e66e5d5c36940a4ffb54502.tar.gz
minetest-f9a90383e14a02ab0e66e5d5c36940a4ffb54502.tar.bz2
minetest-f9a90383e14a02ab0e66e5d5c36940a4ffb54502.zip
Remove expensive copy of ContentFeatures
Diffstat (limited to 'src')
-rw-r--r--src/map.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 409504232..66fabaf87 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -1614,7 +1614,7 @@ s32 Map::transforming_liquid_size() {
return m_transforming_liquid.size();
}
-void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
+void Map::transformLiquids(std::map<v3s16, MapBlock*> &modified_blocks)
{
INodeDefManager *nodemgr = m_gamedef->ndef();
@@ -1632,7 +1632,7 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
std::deque<v3s16> must_reflow;
// List of MapBlocks that will require a lighting update (due to lava)
- std::map<v3s16, MapBlock*> lighting_modified_blocks;
+ std::map<v3s16, MapBlock *> lighting_modified_blocks;
u32 liquid_loop_max = g_settings->getS32("liquid_loop_max");
u32 loop_max = liquid_loop_max;
@@ -1675,7 +1675,7 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
s8 liquid_level = -1;
content_t liquid_kind = CONTENT_IGNORE;
content_t floodable_node = CONTENT_AIR;
- ContentFeatures cf = nodemgr->get(n0);
+ const ContentFeatures &cf = nodemgr->get(n0);
LiquidType liquid_type = cf.liquid_type;
switch (liquid_type) {
case LIQUID_SOURCE:
@@ -1721,7 +1721,7 @@ void Map::transformLiquids(std::map<v3s16, MapBlock*> & modified_blocks)
}
v3s16 npos = p0 + dirs[i];
NodeNeighbor nb(getNodeNoEx(npos), nt, npos);
- ContentFeatures cfnb = nodemgr->get(nb.n);
+ const ContentFeatures &cfnb = nodemgr->get(nb.n);
switch (nodemgr->get(nb.n.getContent()).liquid_type) {
case LIQUID_NONE:
if (cfnb.floodable) {