summaryrefslogtreecommitdiff
path: root/src/utils/empty_if_fixed_server.hpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2020-05-04 23:55:39 +0200
committerlouiz’ <louiz@louiz.org>2020-05-04 23:55:39 +0200
commit10d683354b739ae2567c7898ae11479413dc475a (patch)
tree3f87fbc934af457926b2861d5f975c1ad1674529 /src/utils/empty_if_fixed_server.hpp
parentc91fac82da5d3cae0f363eb6b75017808837125b (diff)
downloadbiboumi-10d683354b739ae2567c7898ae11479413dc475a.tar.gz
biboumi-10d683354b739ae2567c7898ae11479413dc475a.tar.bz2
biboumi-10d683354b739ae2567c7898ae11479413dc475a.tar.xz
biboumi-10d683354b739ae2567c7898ae11479413dc475a.zip
Fix clang warnings on some utils function. It’s also faster
Diffstat (limited to 'src/utils/empty_if_fixed_server.hpp')
-rw-r--r--src/utils/empty_if_fixed_server.hpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/utils/empty_if_fixed_server.hpp b/src/utils/empty_if_fixed_server.hpp
index cbb9cea..2422ee4 100644
--- a/src/utils/empty_if_fixed_server.hpp
+++ b/src/utils/empty_if_fixed_server.hpp
@@ -7,17 +7,11 @@
namespace utils
{
- inline std::string empty_if_fixed_server(std::string&& str)
+ inline const std::string& empty_if_fixed_server(const std::string& str)
{
+ static const std::string empty{};
if (!Config::get("fixed_irc_server", "").empty())
- return {};
- return std::move(str);
- }
-
- inline std::string empty_if_fixed_server(const std::string& str)
- {
- if (!Config::get("fixed_irc_server", "").empty())
- return {};
+ return empty;
return str;
}