Changeset 8779


Ignore:
Timestamp:
03/15/05 16:09:15 (16 years ago)
Author:
piso
Message:

psxhash()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/AbstractVector.java

    r8660 r8779  
    208208    }
    209209
     210    // For EQUALP hash tables.
     211    public int psxhash()
     212    {
     213        try {
     214            final int length = length();
     215            final int limit = length < 4 ? length : 4;
     216            long result = 48920713; // Chosen at random.
     217            for (int i = 0; i < length; i++)
     218                result = mix(result, getRowMajor(i).psxhash());
     219            return (int) (result & 0x7fffffff);
     220        }
     221        catch (Throwable t) {
     222            // Shouldn't happen.
     223            Debug.trace(t);
     224            return 0;
     225        }
     226    }
     227
    210228    public abstract AbstractVector adjustVector(int size,
    211229                                                LispObject initialElement,
Note: See TracChangeset for help on using the changeset viewer.