CVar: Use std::string::empty where applicable

We can use empty() instead of comparing against a default constructed
new instance.
This commit is contained in:
Lioncash 2019-10-19 19:22:00 -04:00
parent dfcad01c2f
commit 23f323b0f7
1 changed files with 1 additions and 2 deletions

View File

@ -80,8 +80,7 @@ CVar::CVar(std::string_view name, uint32_t value, std::string_view help, CVar::E
} }
std::string CVar::help() const { std::string CVar::help() const {
return std::string(m_help + (m_defaultValue != std::string() ? "\ndefault: " + m_defaultValue : "") + return m_help + (m_defaultValue.empty() ? "" : "\ndefault: " + m_defaultValue) + (isReadOnly() ? " [ReadOnly]" : "");
(isReadOnly() ? " [ReadOnly]" : ""));
} }
atVec2f CVar::toVec2f(bool* isValid) const { atVec2f CVar::toVec2f(bool* isValid) const {