Changeset 13015


Ignore:
Timestamp:
11/09/10 15:54:26 (13 years ago)
Author:
ehuelsmann
Message:

Eliminate duplicate lookups in JHandler

Patch by: Mario Lang, mlang at delysid dot org

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/JHandler.java

    r12513 r13015  
    6767    {
    6868        if (table.containsKey(o)) {
    69             Map<String,Entry> entryTable =  (Map<String,Entry>)table.get(o);
     69            Map<String,Entry> entryTable = table.get(o);
    7070            if (entryTable.containsKey(s)) {
    71                 Function f = ((Entry)entryTable.get(s)).getHandler();
    72                 LispObject data = ((Entry)entryTable.get(s)).getData();
    73                 Fixnum count = ((Entry)entryTable.get(s)).getCount();
    74                 Fixnum[] lispAi = new Fixnum[ai.length];
     71                final Entry entry = entryTable.get(s);
     72                final Function f = entry.getHandler();
     73                final LispObject data = entry.getData();
     74                final Fixnum count = entry.getCount();
     75                final Fixnum[] lispAi = new Fixnum[ai.length];
    7576                for (int i = 0; i < ai.length; i++) {
    7677                    lispAi[i] = Fixnum.getInstance(ai[i]);
    7778                }
    78                 LispObject lispAiVector = new SimpleVector(lispAi);
    79                 SimpleString[] lispAs = new SimpleString[as.length];
     79                final LispObject lispAiVector = new SimpleVector(lispAi);
     80                final SimpleString[] lispAs = new SimpleString[as.length];
    8081                for (int i = 0; i < as.length; i++) {
    8182                    lispAs[i] = new SimpleString(as[i]);
    8283                }
    83                 LispObject lispAsVector = new SimpleVector(lispAs);
    84                 LispObject[] args = new LispObject[] //FIXME: count -> seq_num
    85                 { data, new JavaObject(o), lispAiVector, lispAsVector, internKeyword(s), count };
     84                final LispObject lispAsVector = new SimpleVector(lispAs);
     85                LispObject[] args =
     86                    new LispObject[] //FIXME: count -> seq_num
     87                    { data,
     88                      new JavaObject(o),
     89                      lispAiVector,
     90                      lispAsVector,
     91                      internKeyword(s),
     92                      count };
    8693                f.execute(args);
    8794            }
Note: See TracChangeset for help on using the changeset viewer.