jakarta-oro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: jakarta-oro/src/java/org/apache/oro/text GlobCompiler.java
Date Thu, 24 Jun 2004 16:28:08 GMT
dfs         2004/06/24 09:28:08

  Modified:    src/java/org/apache/oro/text GlobCompiler.java
  Log:
  Compacted the implementation of __isPerl5MetaCharacter and
  __isGlobMetaCharacter by using String.indexOf (it's easier to read;
  not necessarily any faster).
  
  Revision  Changes    Path
  1.10      +3 -5      jakarta-oro/src/java/org/apache/oro/text/GlobCompiler.java
  
  Index: GlobCompiler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-oro/src/java/org/apache/oro/text/GlobCompiler.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- GlobCompiler.java	13 Feb 2004 22:01:59 -0000	1.9
  +++ GlobCompiler.java	24 Jun 2004 16:28:08 -0000	1.10
  @@ -123,13 +123,11 @@
     private Perl5Compiler __perl5Compiler;
   
     private static boolean __isPerl5MetaCharacter(char ch) {
  -    return (ch == '*' || ch == '?' || ch == '+' || ch == '[' || ch == ']' || 
  -	    ch == '(' || ch == ')' || ch == '|' || ch == '^' || ch == '$' ||
  -	    ch == '.' || ch == '{' || ch == '}' || ch == '\\');
  +    return ("'*?+[]()|^$.{}\\".indexOf(ch) >= 0);
     }
   
     private static boolean __isGlobMetaCharacter(char ch) {
  -    return (ch == '*' || ch == '?' || ch == '[' || ch == ']');
  +    return ("*?[]".indexOf(ch) >= 0);
     }
   
     /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: oro-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: oro-dev-help@jakarta.apache.org


Mime
View raw message