You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-dev@jakarta.apache.org by df...@apache.org on 2004/06/24 18:28:08 UTC

cvs commit: jakarta-oro/src/java/org/apache/oro/text GlobCompiler.java

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