mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-15 17:54:50 +00:00
fix #479
This commit is contained in:
4 files changed
+24
-6
No files matched your search
@@ -35,8 +35,15 @@ class RecipeHandlerQuery<T extends IRecipeHandler> {
|
||||
|
||||
ArrayList<T> runWithProfiling(String profilerSection) {
|
||||
TaskProfiler profiler = ProfilerRecipeHandler.getProfiler();
|
||||
profiler.clear();
|
||||
profiler.start(profilerSection);
|
||||
|
||||
// Save the current config state here, as it may be altered
|
||||
// if getRecipeHandlesParallel took so long and player accidentally changed config.
|
||||
boolean profileRecipes = NEIClientConfig.isProfileRecipeEnabled();
|
||||
if (profileRecipes) {
|
||||
profiler.clear();
|
||||
profiler.start(profilerSection);
|
||||
}
|
||||
|
||||
try {
|
||||
ArrayList<T> handlers = getRecipeHandlersParallel();
|
||||
|
||||
@@ -49,7 +56,7 @@ class RecipeHandlerQuery<T extends IRecipeHandler> {
|
||||
displayRecipeLookupError();
|
||||
return new ArrayList<>(0);
|
||||
} finally {
|
||||
profiler.end();
|
||||
if (profileRecipes) profiler.end();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user