summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-05-09 01:42:14 +0100
committerSadie Powell <sadie@witchery.services>2020-05-09 01:42:45 +0100
commite39ea0e3c82727a2df61a47cda22637c7bfb5457 (patch)
tree744a5c907d696a119bbe45e11ea220f1222a4e73 /src
parent1909304dc0017f08996daff4acaf9cd3bcb32a95 (diff)
regex_stdlib: Don't copy std::regex_error when catching it.
Diffstat (limited to 'src')
-rw-r--r--src/modules/extra/m_regex_stdlib.cpp5
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());
}