Skip to content

Another set of refactoring changes#120

Open
LiamMehle wants to merge 8 commits intorichonguzman:mainfrom
LiamMehle:refactor-2
Open

Another set of refactoring changes#120
LiamMehle wants to merge 8 commits intorichonguzman:mainfrom
LiamMehle:refactor-2

Conversation

@LiamMehle
Copy link
Copy Markdown

Set of commits includes:

  • optimizations to avoid allocating some of the strings on the heap repeatedly in the menu,
  • renaming of some variables,
  • marking functions as static since they're not used outside of the menu_utils.cpp translation unit,
  • using an enum instead of literal numbers when checking bluetooth type
  • a bit of cleanup

LiamMehle added 8 commits June 4, 2024 21:50
if they're not used in other translation units, functions can be marked static to avoid them being needlessly exported by the compiler
marking variables as const is generally good practice
`String` is a heap-allocated string. One is created implicitly due to the return type of the helper functions. They're not mutated, so a reference to a static String that is allocated once can be returned instead.
returning from a function returns control flow back to the calling function immediately
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant