mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Fix missing profiler.pop() in PathFinder::findPath (#10320)
This commit is contained in:
parent
ce6e3b23da
commit
c136006ed0
1 changed files with 2 additions and 2 deletions
|
@ -100,8 +100,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- }).min(Comparator.comparingInt(Path::getNodeCount)) : set.stream().map((target) -> {
|
||||
- return this.reconstructPath(target.getBestNode(), positions.get(target), false);
|
||||
- }).min(Comparator.comparingDouble(Path::getDistToTarget).thenComparingInt(Path::getNodeCount));
|
||||
- profiler.pop();
|
||||
- return optional.isEmpty() ? null : optional.get();
|
||||
+ // Paper start - Perf: remove streams and optimize collection
|
||||
+ Path best = null;
|
||||
+ boolean entryListIsEmpty = entryList.isEmpty();
|
||||
|
@ -112,6 +110,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ if (best == null || comparator.compare(path, best) < 0)
|
||||
+ best = path;
|
||||
+ }
|
||||
profiler.pop();
|
||||
- return optional.isEmpty() ? null : optional.get();
|
||||
+ return best;
|
||||
+ // Paper end - Perf: remove streams and optimize collection
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue