perf: UITheme::getMetrics const and const-ref usage (#1094)
## Summary **What is the goal of this PR?** Small cleanup to make getTheme and getMetrics methods on UITheme const. They return const refs, so updated call sites to use `const auto&`. Realistically this won't make much performance difference, but it better conveys the nature of theme metrics being shared const state. --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**NO**_
This commit is contained in:
@@ -14,8 +14,8 @@ class UITheme {
|
||||
UITheme();
|
||||
static UITheme& getInstance() { return instance; }
|
||||
|
||||
const ThemeMetrics& getMetrics() { return *currentMetrics; }
|
||||
const BaseTheme& getTheme() { return *currentTheme; }
|
||||
const ThemeMetrics& getMetrics() const { return *currentMetrics; }
|
||||
const BaseTheme& getTheme() const { return *currentTheme; }
|
||||
void reload();
|
||||
void setTheme(CrossPointSettings::UI_THEME type);
|
||||
static int getNumberOfItemsPerPage(const GfxRenderer& renderer, bool hasHeader, bool hasTabBar, bool hasButtonHints,
|
||||
|
||||
Reference in New Issue
Block a user