From 23f323b0f78edf49ab498fe9f5a2b356e85ce52d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 19 Oct 2019 19:22:00 -0400 Subject: [PATCH] CVar: Use std::string::empty where applicable We can use empty() instead of comparing against a default constructed new instance. --- hecl/lib/CVar.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hecl/lib/CVar.cpp b/hecl/lib/CVar.cpp index 37575eb6a..6380bacae 100644 --- a/hecl/lib/CVar.cpp +++ b/hecl/lib/CVar.cpp @@ -80,8 +80,7 @@ CVar::CVar(std::string_view name, uint32_t value, std::string_view help, CVar::E } std::string CVar::help() const { - return std::string(m_help + (m_defaultValue != std::string() ? "\ndefault: " + m_defaultValue : "") + - (isReadOnly() ? " [ReadOnly]" : "")); + return m_help + (m_defaultValue.empty() ? "" : "\ndefault: " + m_defaultValue) + (isReadOnly() ? " [ReadOnly]" : ""); } atVec2f CVar::toVec2f(bool* isValid) const {