Commit e53c4141 authored by Mark Olesen's avatar Mark Olesen
Browse files

COMP: avoid bind to temporary

parent 4e5224f9
......@@ -91,7 +91,8 @@ namespace Foam
const bool invert=false
)
{
return findStrings(regExp(rePattern), lst, invert);
const regExp re(rePattern);
return findStrings(re, lst, invert);
}
//- Return list indices for strings matching the regular expression
......@@ -104,7 +105,8 @@ namespace Foam
const bool invert=false
)
{
return findMatchingStrings(regExp(rePattern), lst, invert);
const regExp re(rePattern);
return findMatchingStrings(re, lst, invert);
}
//- Return list indices for strings matching the regular expression
......@@ -171,7 +173,8 @@ namespace Foam
const bool invert=false
)
{
return subsetMatchingStrings(regExp(rePattern), lst, invert);
const regExp re(rePattern);
return subsetMatchingStrings(re, lst, invert);
}
//- Extract elements of StringList when regular expression matches
......@@ -184,7 +187,8 @@ namespace Foam
const bool invert=false
)
{
return subsetMatchingStrings(regExp(rePattern), lst, invert);
const regExp re(rePattern);
return subsetMatchingStrings(re, lst, invert);
}
//- Extract elements of StringList when regular expression matches
......@@ -249,7 +253,8 @@ namespace Foam
const bool invert=false
)
{
inplaceSubsetMatchingStrings(regExp(rePattern), lst, invert);
const regExp re(rePattern);
inplaceSubsetMatchingStrings(re, lst, invert);
}
//- Inplace extract elements of StringList when regular expression matches
......@@ -262,7 +267,8 @@ namespace Foam
const bool invert=false
)
{
inplaceSubsetMatchingStrings(regExp(rePattern), lst, invert);
const regExp re(rePattern);
inplaceSubsetMatchingStrings(re, lst, invert);
}
//- Inplace extract elements of StringList when regular expression matches
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment