From 974d1b9e6d174f1680604b2872911110f6a0e41c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 13 Jan 2023 01:25:20 -0800 Subject: Avoid unnecessary uses of make_optional --- alc/alconfig.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'alc/alconfig.cpp') diff --git a/alc/alconfig.cpp b/alc/alconfig.cpp index 7c1eec6d..14b2580d 100644 --- a/alc/alconfig.cpp +++ b/alc/alconfig.cpp @@ -486,36 +486,36 @@ void ReadALConfig() al::optional ConfigValueStr(const char *devName, const char *blockName, const char *keyName) { if(const char *val{GetConfigValue(devName, blockName, keyName)}) - return al::make_optional(val); + return val; return al::nullopt; } al::optional ConfigValueInt(const char *devName, const char *blockName, const char *keyName) { if(const char *val{GetConfigValue(devName, blockName, keyName)}) - return al::make_optional(static_cast(std::strtol(val, nullptr, 0))); + return static_cast(std::strtol(val, nullptr, 0)); return al::nullopt; } al::optional ConfigValueUInt(const char *devName, const char *blockName, const char *keyName) { if(const char *val{GetConfigValue(devName, blockName, keyName)}) - return al::make_optional(static_cast(std::strtoul(val, nullptr, 0))); + return static_cast(std::strtoul(val, nullptr, 0)); return al::nullopt; } al::optional ConfigValueFloat(const char *devName, const char *blockName, const char *keyName) { if(const char *val{GetConfigValue(devName, blockName, keyName)}) - return al::make_optional(std::strtof(val, nullptr)); + return std::strtof(val, nullptr); return al::nullopt; } al::optional ConfigValueBool(const char *devName, const char *blockName, const char *keyName) { if(const char *val{GetConfigValue(devName, blockName, keyName)}) - return al::make_optional(al::strcasecmp(val, "on") == 0 || al::strcasecmp(val, "yes") == 0 - || al::strcasecmp(val, "true")==0 || atoi(val) != 0); + return al::strcasecmp(val, "on") == 0 || al::strcasecmp(val, "yes") == 0 + || al::strcasecmp(val, "true")==0 || atoi(val) != 0; return al::nullopt; } -- cgit v1.2.3