diff options
author | Peter Powell <petpow@saberuk.com> | 2013-08-27 07:54:16 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2013-08-27 12:20:03 +0100 |
commit | eaf658de3d1ef984c9a0b4273a9cfbd3029f8b5b (patch) | |
tree | 6d20eef5fd9b98fecd93df2caf197ad08c168562 /src/modules/extra/m_regex_posix.cpp | |
parent | 0e7f74a7c8e804a0223b4d88bf637649838f0412 (diff) |
Fix various small issues.
- Add CXX11_OVERRIDE to *Regex::Matches and *RegexFactory::Create.
- Fix documentation comment on regex_string.
- Fix various code duplication/layout issues.
Diffstat (limited to 'src/modules/extra/m_regex_posix.cpp')
-rw-r--r-- | src/modules/extra/m_regex_posix.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/modules/extra/m_regex_posix.cpp b/src/modules/extra/m_regex_posix.cpp index 6c52a935b..935cdbf92 100644 --- a/src/modules/extra/m_regex_posix.cpp +++ b/src/modules/extra/m_regex_posix.cpp @@ -54,14 +54,9 @@ class POSIXRegex : public Regex regfree(®buf); } - bool Matches(const std::string& text) + bool Matches(const std::string& text) CXX11_OVERRIDE { - if (regexec(®buf, text.c_str(), 0, NULL, 0) == 0) - { - // Bang. :D - return true; - } - return false; + return (regexec(®buf, text.c_str(), 0, NULL, 0) == 0); } }; @@ -70,7 +65,7 @@ class PosixFactory : public RegexFactory public: bool extended; PosixFactory(Module* m) : RegexFactory(m, "regex/posix") {} - Regex* Create(const std::string& expr) + Regex* Create(const std::string& expr) CXX11_OVERRIDE { return new POSIXRegex(expr, extended); } |