Changeset 12394


Ignore:
Timestamp:
01/23/10 13:40:34 (11 years ago)
Author:
ehuelsmann
Message:

Remove premature optimization: new array creation is faster than

field access; at the same time, don't create too many new arrays.

File:
1 edited

Legend:

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

    r12342 r12394  
    5555  private static final int STATE_AUX      = 4;
    5656
    57   private static final Parameter[] emptyParameterArray;
    58   static
    59     {
    60         emptyParameterArray = new Parameter[0];
    61     }
    62   private Parameter[] requiredParameters = emptyParameterArray;
    63   private Parameter[] optionalParameters = emptyParameterArray;
    64   private Parameter[] keywordParameters = emptyParameterArray;
    65   private Parameter[] auxVars = emptyParameterArray;
     57  private Parameter[] requiredParameters = new Parameter[0];
     58  private Parameter[] optionalParameters = requiredParameters;
     59  private Parameter[] keywordParameters = requiredParameters;
     60  private Parameter[] auxVars = requiredParameters;
    6661  private final LispObject body;
    6762  private final LispObject executionBody;
     
    7671  private int maxArgs;
    7772
    78   private static final Symbol[] emptySymbolArray;
    79   static
    80     {
    81         emptySymbolArray = new Symbol[0];
    82     }
    83   private Symbol[] variables = emptySymbolArray;
     73  private Symbol[] variables = new Symbol[0];
    8474  private LispObject specials = NIL;
    8575
Note: See TracChangeset for help on using the changeset viewer.