mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
MapBlock::actuallyUpdateDayNightDiff(): little performance optimization
don't check isLightDayNightEq if checked on previous node
This commit is contained in:
parent
c27504a322
commit
4eb59aeeb2
@ -366,12 +366,19 @@ void MapBlock::actuallyUpdateDayNightDiff()
|
||||
/*
|
||||
Check if any lighting value differs
|
||||
*/
|
||||
|
||||
MapNode previous_n;
|
||||
for (u32 i = 0; i < nodecount; i++) {
|
||||
MapNode &n = data[i];
|
||||
MapNode n = data[i];
|
||||
|
||||
// If node is identical to previous node, don't verify if it differs
|
||||
if (n == previous_n)
|
||||
continue;
|
||||
|
||||
differs = !n.isLightDayNightEq(nodemgr);
|
||||
if (differs)
|
||||
break;
|
||||
previous_n = n;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user