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

IOS: Allow for heterogenous name lookup #9391

Merged
merged 2 commits into from Dec 30, 2020

Conversation

lioncash
Copy link
Member

Allows lookups to be done with std::string_view or any other string type. This allows for non-allocating strings to be used with the name lookup without needing to construct a std::string.

While we're at it, we can make use of insert_or_assign in AddDevice to elide unnecessary default constructions (not like it particularly matters, however it's essentially a "free" change, so why not).

Source/Core/Core/IOS/IOS.h Show resolved Hide resolved
Allows lookups to be done with std::string_view or any other string
type. This allows for non-allocating strings to be used with the name
lookup without needing to construct a std::string.
operator[] performs a default construction if an object at the given key
doesn't exist before overwriting it with the one we provide in operator=

insert_or_assign performs optimal insertion by avoiding the default
construction if an entry doesn't exist.

Not a game changer, but it is essentially a "free" change.
@leoetlino leoetlino merged commit 8a3b14d into dolphin-emu:master Dec 30, 2020
10 checks passed
@lioncash lioncash deleted the find-str branch December 30, 2020 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants