Commit afec252
authored
Optimize layer iteration to prevent performance overhead. (#3022)
* Optimize layer iteration to prevent performance overhead.
Adjusted the layer iteration logic in the Region class to use the minimum and maximum Y-values from the chunk. This prevents unnecessary iterations when getMinimumY or getMaximumY returns extreme values, improving performance efficiency.
* Optimize layer iteration logic in Region class.
Refactored the loop to reduce repeated evaluations by storing pre-calculated min and max values for Y coordinates. This change enhances readability and may improve performance by minimizing unnecessary calculations during the iteration process.
* Update variable naming
* Shift bitwise operations to variable initialization1 parent b548219 commit afec252
File tree
1 file changed
+6
-2
lines changed- worldedit-core/src/main/java/com/sk89q/worldedit/regions
1 file changed
+6
-2
lines changedLines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
407 | 409 | | |
408 | 410 | | |
409 | 411 | | |
| |||
457 | 459 | | |
458 | 460 | | |
459 | 461 | | |
460 | | - | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
461 | 465 | | |
462 | 466 | | |
463 | 467 | | |
| |||
0 commit comments