java/src/org/openantivirus/engine/credo WildcardPattern.java,1.2,1.3

Kurt Huwig <[email protected]> Sun, 19 Sep 2004 14:01:40 +0000
Newsgroups gmane.comp.security.virus.openantivirus.cvs
Message-ID <[email protected]>
Update of /cvsroot/openantivirus/java/src/org/openantivirus/engine/credo
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12699/java/src/org/openantivirus/engine/credo

Modified Files:
	WildcardPattern.java 
Log Message:
Replaced custom hex-conversion code with call to Java lib

Index: WildcardPattern.java
===================================================================
RCS file: /cvsroot/openantivirus/java/src/org/openantivirus/engine/credo/WildcardPattern.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- WildcardPattern.java	26 May 2004 20:08:47 -0000	1.2
+++ WildcardPattern.java	19 Sep 2004 14:01:37 -0000	1.3
@@ -39,8 +39,6 @@
     public final byte[] pattern;
     public final int[] skipList;
     
-    private final String HEXDIGITS = "0123456789ABCDEF";
-    
     public WildcardPattern(String hex) {
         if (hex.length() % 2 != 0) {
             throw new IllegalArgumentException("Malformed hexstring: " + hex);
@@ -71,8 +69,8 @@
                     colSkipList.add(new Integer(skipCount));
                     skipCount = 1;
                 }
-                pattern[i / 2] = (byte) ((HEXDIGITS.indexOf(c1) << 4)
-                                         + HEXDIGITS.indexOf(c2));
+                pattern[i / 2] = (byte) ((Character.digit(c1, 16) << 4)
+                                         + Character.digit(c2, 16));
             }
         }
         



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php