-
Notifications
You must be signed in to change notification settings - Fork 174
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
Housekeeping: Update use of "auto" with plugin lists. #1340
Conversation
The following links are available: build (ubuntu-18.04, full)
build (macOS-latest, full) build (windows-latest, full) |
@@ -3466,7 +3466,7 @@ void Application::initializeUi() { | |||
#if !defined(DISABLE_QML) | |||
// Now that the menu is instantiated, ensure the display plugin menu is properly updated | |||
{ | |||
auto displayPlugins = PluginManager::getInstance()->getDisplayPlugins(); | |||
DisplayPluginList displayPlugins = PluginManager::getInstance()->getDisplayPlugins(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this one? Is there a const missing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This cannot be a constant reference as the code below this line sorts the plugin list, so it needs to start with a copy of the list.
I'm not sure why I changed it from "auto", it may have slipped through from a previous revision of this PR.
The following links are available: build (macOS-10.15, full) build (ubuntu-18.04, full)
build (windows-latest, full) build (self-hosted_debian-11_aarch64, full)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me on Windows, tested with a Valve Index through SteamVR. I don't expect this will get more testing, so it should be good to merge, we'll tackle any issues that come up in further PR builds.
The following links are available:
build (macOS-10.15, client) build (windows-latest, full) |
The returned plugin lists are all coming back as "const&" and in most cases are assigned to "auto" (which strips out qualifiers).
This adds in as many "const auto&" ref qualifiers as I could for plugin references so as to reduce unnecessary copies.
(This came out of a tooltip while poking at the networking code)
Testing focus: