From 19b2bdd6e4e84ef46d807379e8e3235fb21851f2 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Thu, 23 Jul 2026 11:12:00 +0300 Subject: [PATCH] mu-priority: make to_string inline And remove some dead code. --- lib/message/mu-priority.cc | 8 +------- lib/message/mu-priority.hh | 26 ++++++-------------------- 2 files changed, 7 insertions(+), 27 deletions(-) diff --git a/lib/message/mu-priority.cc b/lib/message/mu-priority.cc index 9b57cea9..e2daa71e 100644 --- a/lib/message/mu-priority.cc +++ b/lib/message/mu-priority.cc @@ -1,5 +1,5 @@ /* -** Copyright (C) 2022 Dirk-Jan C. Binnema +** Copyright (C) 2022-2026 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -21,12 +21,6 @@ using namespace Mu; -std::string -Mu::to_string(Priority prio) -{ - return std::string{priority_name(prio)}; -} - /* * tests... also build as runtime-tests, so we can get coverage info */ diff --git a/lib/message/mu-priority.hh b/lib/message/mu-priority.hh index c1dc91bf..8c050c4f 100644 --- a/lib/message/mu-priority.hh +++ b/lib/message/mu-priority.hh @@ -121,25 +121,6 @@ priority_name(Priority prio) } } -/** - * Get the name for a given priority (backward compatibility) - * - * @return the name - */ -constexpr const char* -priority_name_c_str(Priority prio) -{ - switch (prio) { - case Priority::Low: - return "low"; - case Priority::High: - return "high"; - case Priority::Normal: - default: - return "normal"; - } -} - /** * Get a the message priority as a string * @@ -147,7 +128,12 @@ priority_name_c_str(Priority prio) * * @return a string */ -std::string to_string(Priority prio); +constexpr std::string +to_string(Priority prio) +{ + return std::string{priority_name(prio)}; +} + } // namespace Mu