diff --git a/src/util/demangle.cpp b/src/util/demangle.cpp index 01ea83ec..e8b0754e 100644 --- a/src/util/demangle.cpp +++ b/src/util/demangle.cpp @@ -61,13 +61,13 @@ namespace util { sym_initialised = true; } - std::string demangle(const char* symbol) { + std::string demangle(const char* symbol) noexcept { // If the symbol is null or the empty string then just return it if (symbol == nullptr || symbol[0] == '\0') { return ""; } - std::lock_guard lock(symbol_mutex); + const std::lock_guard lock(symbol_mutex); // Initialise the symbols if we have to if (!sym_initialised) { @@ -110,7 +110,7 @@ namespace util { * * @return the demangled symbol, or the original string if it could not be demangled */ - std::string demangle(const char* symbol) { + std::string demangle(const char* symbol) noexcept { if (symbol == nullptr) { return {}; diff --git a/src/util/demangle.hpp b/src/util/demangle.hpp index e92a6035..cb18b82a 100644 --- a/src/util/demangle.hpp +++ b/src/util/demangle.hpp @@ -28,7 +28,7 @@ namespace NUClear { namespace util { - std::string demangle(const char* symbol); + std::string demangle(const char* symbol) noexcept; } // namespace util } // namespace NUClear