Enforce preference of preincrementation wherever applicable #8042
Closed
Chubercik
started this conversation in
Engine Core
Replies: 1 comment 2 replies
-
Please check whether this is the case with Godbolt when using a modern GCC or Clang version with release optimizations enabled. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Although the performance boost might be negligible (if at all present due to how modern compilers should be able to squeeze out any optimizations possible), wouldn't it make sense to enforce a code quality check for using preincrementation in certain code structures, e.g.
for
loops, where we don't really care about the return value of thei++
statement?As it stands, currently there are both
i++
and++i
statements in Godot's codebase, enforcing one or the other would make it more uniform.Beta Was this translation helpful? Give feedback.
All reactions