Skip to content

Commit

Permalink
Make demangle noexcept
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentHouliston committed Aug 15, 2024
1 parent c028329 commit dfd32b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/util/demangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::mutex> lock(symbol_mutex);
const std::lock_guard<std::mutex> lock(symbol_mutex);

// Initialise the symbols if we have to
if (!sym_initialised) {
Expand Down Expand Up @@ -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 {};
Expand Down
2 changes: 1 addition & 1 deletion src/util/demangle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dfd32b9

Please sign in to comment.