Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another set of refactoring changes #120

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

LiamMehle
Copy link

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

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