FEXCore/Config: Stop making temporary string copies

For config values that were string objects we were unnecessary creating
copies each time the string was accessed.

Convert the () operator over to returning a reference.
This commit is contained in:
Ryan Houdek 2023-08-16 21:35:13 -07:00
parent 6cb0f52e94
commit fe37c89109

View File

@ -286,7 +286,13 @@ namespace Type {
}
operator T() const { return ValueData; }
template <typename TT = T> requires (!std::is_same_v<TT, fextl::string>)
T operator()() const { return ValueData; }
template <typename TT = T> requires (std::is_same_v<TT, fextl::string>)
const T& operator()() const { return ValueData; }
Value<T>(T Value) { ValueData = std::move(Value); }
fextl::list<T> &All() { return AppendList; }