Efficiency and better use of API#916
Open
ZenSirzechs wants to merge 1 commit intoCloudburstMC:masterfrom
ZenSirzechs:master
Open
Efficiency and better use of API#916ZenSirzechs wants to merge 1 commit intoCloudburstMC:masterfrom ZenSirzechs:master
ZenSirzechs wants to merge 1 commit intoCloudburstMC:masterfrom
ZenSirzechs:master
Conversation
SupremeMortal
requested changes
Nov 1, 2019
|
|
||
| public static int clamp(int check, int min, int max) { | ||
| return check > max ? max : (check < min ? min : check); | ||
| return check > max ? max : (Math.max(check, min)); |
Member
There was a problem hiding this comment.
This method can be removed since there is an identical one in NukkitMath
|
|
||
| public static double clamp(double value, double min, double max) { | ||
| return value < min ? min : (value > max ? max : value); | ||
| return value < min ? min : (Math.min(value, max)); |
Member
There was a problem hiding this comment.
Makes more sense to keep the operators in this class.
|
|
||
| public static int clamp(int value, int min, int max) { | ||
| return value < min ? min : (value > max ? max : value); | ||
| return value < min ? min : (Math.min(value, max)); |
| diffZ = Math.abs(diffZ); | ||
|
|
||
| return diffX > diffZ ? diffX : diffZ; | ||
| return Math.max(diffX, diffZ); |
| switch (this.type) { | ||
| case Config.PROPERTIES: | ||
| content = this.writeProperties(); | ||
| content = new StringBuilder(this.writeProperties()); |
Member
There was a problem hiding this comment.
StringBuilder has already been initialised above.
| break; | ||
| case Config.JSON: | ||
| content = new GsonBuilder().setPrettyPrinting().create().toJson(this.config); | ||
| content = new StringBuilder(new GsonBuilder().setPrettyPrinting().create().toJson(this.config)); |
| dumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); | ||
| Yaml yaml = new Yaml(dumperOptions); | ||
| content = yaml.dump(this.config); | ||
| content = new StringBuilder(yaml.dump(this.config)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.