Erik Huelsmann | 4 Aug 21:22

[PATCH] Don't do unnecessary work: clrhash on empty hash

The attached patch doesn't do much for the build-time of ABCL (not as
much as the 10% when the equivalent patch went into SBCL), but it's
still nice not to do too much work.

Bye,

Erik.

Index: HashTable.java
===================================================================
RCS file: /cvsroot/armedbear-j/j/j/src/org/armedbear/lisp/HashTable.java,v
retrieving revision 1.57
diff -u -r1.57 HashTable.java
--- HashTable.java	6 Mar 2007 11:40:49 -0000	1.57
+++ HashTable.java	4 Aug 2008 19:20:09 -0000
@@ -150,6 +150,8 @@

   public synchronized void clear()
   {
+    if (count == 0) return;
+
     for (int i = buckets.length; i-- > 0;)
       buckets[i] = null;
     count = 0;

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
(Continue reading)


Gmane