diff options
-rw-r--r-- | al/eax/exception.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/al/eax/exception.cpp b/al/eax/exception.cpp index cd32e11a..e4945d88 100644 --- a/al/eax/exception.cpp +++ b/al/eax/exception.cpp @@ -19,20 +19,12 @@ std::string EaxException::make_message(std::string_view context, std::string_vie if(context.empty() && message.empty()) return what; - static constexpr char left_prefix[] = "["; - static constexpr auto left_prefix_size = std::string::traits_type::length(left_prefix); - - static constexpr char right_prefix[] = "] "; - static constexpr auto right_prefix_size = std::string::traits_type::length(right_prefix); - - what.reserve((!context.empty() ? left_prefix_size + context.size() + right_prefix_size : 0) + - message.length() + 1); - + what.reserve((!context.empty() ? context.size() + 3 : 0) + message.length() + 1); if(!context.empty()) { - what.append(left_prefix, left_prefix_size); + what += "["; what += context; - what.append(right_prefix, right_prefix_size); + what += "] "; } what += message; |