yapeteam / Minecraft-1.8.9-lwjgl3

MCP 1.8.9 using lwjgl3
Apache License 2.0
18 stars 0 forks source link

Mouse.java: normalize() can be optimized #1

Closed DispatchCode closed 1 year ago

DispatchCode commented 1 year ago

https://github.com/TIMER-err/Minecraft-1.8.9-lwjgl3/blob/15eaa8906f1e2d9da927a102687032477d12f8f9/src/org/lwjglx/input/Mouse.java#L243C1-L246C6

The above function can be changed with:

private static int normalize(int input) {
      return Math.abs(input);
}
ChristopherProject commented 1 year ago

Thanks Marco for providing this optimization ^^