Closed ghost closed 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.
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.
I don't understand what you're trying to say. It sounds like you're saying that the "second" check is not referenced.
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.
bye