Skip to content

Commit

Permalink
Add note to use-const rule
Browse files Browse the repository at this point in the history
  • Loading branch information
bbannier committed Dec 4, 2023
1 parent 4d36b0e commit a073220
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rules/use-const.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@ rule:
kind: "integer"

fix: "const"

note: |
'const' variables can potentially be optimized better than 'global'
variables, e.g., they could be inlined while access to a 'global' is always
through an indirection.
This role does not validate whether the 'global' is modified elsewhere so it
can have FALSE POSITIVES.

0 comments on commit a073220

Please sign in to comment.