mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 16:00:18 +02:00
Config: Prevent duplicate lookup in EnvLoader::Load()
We can check the iterator itself instead of doing the lookup again.
This commit is contained in:
1 parent
3247e777c0
commit
acdbbec78d
1 file changed
+4
-3
@@ -283,9 +283,10 @@ void EnvLoader::Load() {
|
||||
}
|
||||
}
|
||||
|
||||
auto GetVar = [](EnvMapType& EnvMap, const std::string_view id) -> std::optional<std::string_view> {
|
||||
if (EnvMap.find(id) != EnvMap.end()) {
|
||||
return EnvMap.at(id);
|
||||
auto GetVar = [](const EnvMapType& EnvMap, std::string_view id) -> std::optional<std::string_view> {
|
||||
const auto EnvEntry = EnvMap.find(id);
|
||||
if (EnvEntry != EnvMap.end()) {
|
||||
return EnvEntry->second;
|
||||
}
|
||||
|
||||
// If envp[] was empty, search using std::getenv()
|
||||
|
||||
Reference in new issue
Block a user