opentibia / server

An open source server for the MMORPG Tibia.
GNU General Public License v2.0
414 stars 149 forks source link

The indentation used in this block causes it to appear that the damage <= 0 guard is guarded by the first "if" when it is not #58

Closed YuLeven closed 7 years ago

YuLeven commented 7 years ago

The way the indentation was used is misleading and cause compile-time warnings. By using brackets and aligning both flow statements, we can be sure that the (damage <= 0) statement isn't being guarded by (elementMod != 0).

ivucica commented 7 years ago

Please remove the space before brace (not bracket 😎) in your first if statement and I will approve the merge.

I'm no fan of that style and I was about to ask that you add a space in the second statement, however rest of the file has this code style.

On Wed, May 24, 2017, 22:42 Yuri Levenhagen notifications@github.com wrote:

The way the indentation was used is misleading and cause compile-time warnings. By using brackets and aligning both flow statements, we can be sure that the (damage <= 0) statement isn't being guarded by (elementMod != 0).

You can view, comment on, or merge this pull request online at:

https://github.com/opentibia/server/pull/58 Commit Summary

  • The indentation used in this block causes it to appear that the damage <= 0 guard is guarded by the first "if" when it is not

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/opentibia/server/pull/58, or mute the thread https://github.com/notifications/unsubscribe-auth/AAdJnJtDI7Qi8HtwehB6_YQIOL4kyXaxks5r9KQvgaJpZM4NltJa .

YuLeven commented 7 years ago

Thanks! I too don't love that style and out of habit ended putting that space in there. It is fixed.