You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/03/28 05:33:12 UTC

[4/5] git commit: TS-1135: add some const qualifiers to DFA::match()

TS-1135: add some const qualifiers to DFA::match()


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/313c224d
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/313c224d
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/313c224d

Branch: refs/heads/master
Commit: 313c224d66fd12800612986b0ad0c58b25a1392a
Parents: 9c1958a
Author: James Peach <jp...@apache.org>
Authored: Thu Mar 22 21:14:51 2012 -0700
Committer: James Peach <jp...@apache.org>
Committed: Tue Mar 27 20:32:26 2012 -0700

----------------------------------------------------------------------
 lib/ts/Regex.cc |    5 +++--
 lib/ts/Regex.h  |    4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/313c224d/lib/ts/Regex.cc
----------------------------------------------------------------------
diff --git a/lib/ts/Regex.cc b/lib/ts/Regex.cc
index 547f988..b881c31 100644
--- a/lib/ts/Regex.cc
+++ b/lib/ts/Regex.cc
@@ -76,6 +76,7 @@ DFA::build(const char *pattern, REFlags flags)
 }
 
 int DFA::compile(const char *pattern, REFlags flags) {
+  ink_assert(_my_patterns == NULL);
   _my_patterns = build(pattern,flags);
   if (_my_patterns) 
     return 0;
@@ -120,13 +121,13 @@ DFA::compile(const char **patterns, int npatterns, REFlags flags)
 }
 
 int
-DFA::match(const char *str)
+DFA::match(const char *str) const
 {
   return match(str,strlen(str));
 }
 
 int
-DFA::match(const char *str, int length)
+DFA::match(const char *str, int length) const
 {
   int rc;
   int ovector[30];

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/313c224d/lib/ts/Regex.h
----------------------------------------------------------------------
diff --git a/lib/ts/Regex.h b/lib/ts/Regex.h
index 12aaffb..14c94ac 100644
--- a/lib/ts/Regex.h
+++ b/lib/ts/Regex.h
@@ -56,8 +56,8 @@ public:
   int compile(const char **patterns, int npatterns, REFlags flags = (REFlags) 0);
   dfa_pattern * build(const char *pattern, REFlags flags = (REFlags) 0);
   
-  int match(const char *str);
-  int match(const char *str, int length);
+  int match(const char *str) const;
+  int match(const char *str, int length) const;
 
 private:
   dfa_pattern * _my_patterns;