mu-priority: make to_string inline
And remove some dead code.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2022 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
** Copyright (C) 2022-2026 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
**
|
||||
** 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
|
||||
*/
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user