GlowstoneMC / Glowstone-Legacy

An open-source server for the Bukkit Minecraft modding interface
Other
363 stars 122 forks source link

Small code duplicate #633

Closed ghost closed 9 years ago

ghost commented 9 years ago

bye

Ribesg commented 9 years ago

Honestly, a method call cost would be non-negligible compared to the actual work done by those 2 identical lines. You often create a method when the work done is bigger than that (at least 2 lines, I would say 3+) and/or if it's used more than twice.

turt2live commented 9 years ago

This really isn't duplication. They are two checks in different places. If the range changes and only one is changed, the issue will become apparent.

Closing as a non-issue.

turt2live commented 9 years ago

I don't understand what you're trying to say. It sounds like you're saying that the "second" check is not referenced.

turt2live commented 9 years ago

The two layers need the check. Reducing both statements increases complexity elsewhere. Not to mention the two points mentioned face different sides of the server: one towards plugins, one towards networking.