From c8eab43489ac16bcbbc63f3c55aa4f97ad722a19 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 21 Oct 2019 01:30:16 -0400 Subject: [PATCH] Console: Make commandExists() a const qualified member function This doesn't modify internal console state, so it can be turned into a const qualified member function. --- hecl/include/hecl/Console.hpp | 2 +- hecl/lib/Console.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hecl/include/hecl/Console.hpp b/hecl/include/hecl/Console.hpp index f9ad9e262..d1ab47ccb 100644 --- a/hecl/include/hecl/Console.hpp +++ b/hecl/include/hecl/Console.hpp @@ -89,7 +89,7 @@ public: void help(Console* con, const std::vector& args); void listCommands(Console* con, const std::vector& args); - bool commandExists(std::string_view cmd); + bool commandExists(std::string_view cmd) const; void vreport(Level level, fmt::string_view format, fmt::format_args args); template > diff --git a/hecl/lib/Console.cpp b/hecl/lib/Console.cpp index 0a7673c3f..af978911d 100644 --- a/hecl/lib/Console.cpp +++ b/hecl/lib/Console.cpp @@ -167,7 +167,7 @@ void Console::listCommands(Console* /*con*/, const std::vector& /*a report(Level::Info, fmt("'{}': {}"), comPair.second.m_displayName, comPair.second.m_helpString); } -bool Console::commandExists(std::string_view cmd) { +bool Console::commandExists(std::string_view cmd) const { std::string cmdName{cmd}; athena::utility::tolower(cmdName);