Skip to content

Commit

Permalink
Merge pull request #18804 from dcamper/hpcc-32126-coverity-regex-9.8
Browse files Browse the repository at this point in the history
HPCC-32126 Performance improvements in regex code (via Coverity)

Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Jun 25, 2024
2 parents b9019bd + f640804 commit f86122c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rtl/eclrtl/eclregex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ class RegexCacheEntry
RegexCacheEntry() = delete;

RegexCacheEntry(size32_t _patternSize, const char * _pattern, uint32_t _options, std::shared_ptr<pcre2_code_8> _compiledRegex8)
: savedOptions(_options), savedPattern(_pattern, _patternSize), compiledRegex8(_compiledRegex8)
: savedOptions(_options), savedPattern(_pattern, _patternSize), compiledRegex8(std::move(_compiledRegex8))
{}

RegexCacheEntry(size32_t _patternSize, const char * _pattern, uint32_t _options, std::shared_ptr<pcre2_code_16> _compiledRegex16)
: savedOptions(_options), savedPattern(_pattern, _patternSize), compiledRegex16(_compiledRegex16)
: savedOptions(_options), savedPattern(_pattern, _patternSize), compiledRegex16(std::move(_compiledRegex16))
{}

RegexCacheEntry(const RegexCacheEntry & other) = delete;
Expand Down Expand Up @@ -254,7 +254,7 @@ class CStrRegExprFindInstance : implements IStrRegExprFindInstance

public:
CStrRegExprFindInstance(std::shared_ptr<pcre2_code_8> _compiledRegex, const char * _subject, size32_t _from, size32_t _len, bool _keep)
: compiledRegex(_compiledRegex)
: compiledRegex(std::move(_compiledRegex))
{
// See if UTF-8 is enabled on this compiled regex
uint32_t option_bits;
Expand Down Expand Up @@ -685,7 +685,7 @@ class CUStrRegExprFindInstance : implements IUStrRegExprFindInstance

public:
CUStrRegExprFindInstance(std::shared_ptr<pcre2_code_16> _compiledRegex, const UChar * _subject, size32_t _from, size32_t _len)
: compiledRegex(_compiledRegex)
: compiledRegex(std::move(_compiledRegex))
{
subject = _subject + _from;
matched = false;
Expand Down

0 comments on commit f86122c

Please sign in to comment.