diff options
author | Sadie Powell <sadie@witchery.services> | 2020-05-09 01:42:14 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2020-05-09 01:42:45 +0100 |
commit | e39ea0e3c82727a2df61a47cda22637c7bfb5457 (patch) | |
tree | 744a5c907d696a119bbe45e11ea220f1222a4e73 /src/modules | |
parent | 1909304dc0017f08996daff4acaf9cd3bcb32a95 (diff) |
regex_stdlib: Don't copy std::regex_error when catching it.
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/extra/m_regex_stdlib.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/modules/extra/m_regex_stdlib.cpp b/src/modules/extra/m_regex_stdlib.cpp index 149ff3b38..b9602fe01 100644 --- a/src/modules/extra/m_regex_stdlib.cpp +++ b/src/modules/extra/m_regex_stdlib.cpp @@ -33,10 +33,11 @@ class StdRegex : public Regex public: StdRegex(const std::string& rx, std::regex::flag_type fltype) : Regex(rx) { - try{ + try + { regexcl.assign(rx, fltype | std::regex::optimize); } - catch(std::regex_error rxerr) + catch(const std::regex_error& rxerr) { throw RegexException(rx, rxerr.what()); } |