[armedbear-cvs] r13015 - trunk/abcl/src/org/armedbear/lisp
Erik Huelsmann
ehuelsmann at common-lisp.net
Tue Nov 9 15:54:27 UTC 2010
Author: ehuelsmann
Date: Tue Nov 9 10:54:26 2010
New Revision: 13015
Log:
Eliminate duplicate lookups in JHandler
Patch by: Mario Lang, mlang at delysid dot org
Modified:
trunk/abcl/src/org/armedbear/lisp/JHandler.java
Modified: trunk/abcl/src/org/armedbear/lisp/JHandler.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/JHandler.java (original)
+++ trunk/abcl/src/org/armedbear/lisp/JHandler.java Tue Nov 9 10:54:26 2010
@@ -66,23 +66,30 @@
public static void callLisp (String s, Object o, String as[], int ai[])
{
if (table.containsKey(o)) {
- Map<String,Entry> entryTable = (Map<String,Entry>)table.get(o);
+ Map<String,Entry> entryTable = table.get(o);
if (entryTable.containsKey(s)) {
- Function f = ((Entry)entryTable.get(s)).getHandler();
- LispObject data = ((Entry)entryTable.get(s)).getData();
- Fixnum count = ((Entry)entryTable.get(s)).getCount();
- Fixnum[] lispAi = new Fixnum[ai.length];
+ final Entry entry = entryTable.get(s);
+ final Function f = entry.getHandler();
+ final LispObject data = entry.getData();
+ final Fixnum count = entry.getCount();
+ final Fixnum[] lispAi = new Fixnum[ai.length];
for (int i = 0; i < ai.length; i++) {
lispAi[i] = Fixnum.getInstance(ai[i]);
}
- LispObject lispAiVector = new SimpleVector(lispAi);
- SimpleString[] lispAs = new SimpleString[as.length];
+ final LispObject lispAiVector = new SimpleVector(lispAi);
+ final SimpleString[] lispAs = new SimpleString[as.length];
for (int i = 0; i < as.length; i++) {
lispAs[i] = new SimpleString(as[i]);
}
- LispObject lispAsVector = new SimpleVector(lispAs);
- LispObject[] args = new LispObject[] //FIXME: count -> seq_num
- { data, new JavaObject(o), lispAiVector, lispAsVector, internKeyword(s), count };
+ final LispObject lispAsVector = new SimpleVector(lispAs);
+ LispObject[] args =
+ new LispObject[] //FIXME: count -> seq_num
+ { data,
+ new JavaObject(o),
+ lispAiVector,
+ lispAsVector,
+ internKeyword(s),
+ count };
f.execute(args);
}
}
More information about the armedbear-cvs
mailing list