Skip to content

Commit

Permalink
Refactor performance of isVerbose
Browse files Browse the repository at this point in the history
  • Loading branch information
Sgitario committed Feb 27, 2023
1 parent 5f73d25 commit a67f9d0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/src/main/java/io/dekorate/utils/Development.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@
*/
public final class Development {

private static final boolean IS_VERBOSE = Session.getSession()
.getConfigurationRegistry().get(GeneratorConfig.class).map(GeneratorConfig::isVerbose)
.orElse(false);

private Development() {
//Utility class
}

public static boolean isVerbose() {
return Session.getSession().getConfigurationRegistry().get(GeneratorConfig.class).map(GeneratorConfig::isVerbose)
.orElse(false);
return IS_VERBOSE;
}
}

0 comments on commit a67f9d0

Please sign in to comment.