Changeset 4637


Ignore:
Timestamp:
11/04/03 01:41:21 (18 years ago)
Author:
piso
Message:

get(), put(): minor performance tweaks.

File:
1 edited

Legend:

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

    r4547 r4637  
    33 *
    44 * Copyright (C) 2002-2003 Peter Graves
    5  * $Id: Lisp.java,v 1.171 2003-10-26 19:13:26 piso Exp $
     5 * $Id: Lisp.java,v 1.172 2003-11-04 01:41:21 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    980980        throws ConditionThrowable
    981981    {
    982         LispObject result = get(symbol, indicator);
    983         return result != null ? result : defaultValue;
    984     }
    985 
    986     // Returns null if there is no property with the specified indicator.
    987     public static final LispObject get(Symbol symbol, LispObject indicator)
    988         throws ConditionThrowable
    989     {
    990         LispObject list = checkList(symbol.getPropertyList());
     982        LispObject list = symbol.getPropertyList();
    991983        while (list != NIL) {
    992984            LispObject obj = list.car();
     
    995987            list = list.cddr();
    996988        }
     989        return defaultValue;
     990    }
     991
     992    // Returns null if there is no property with the specified indicator.
     993    public static final LispObject get(Symbol symbol, LispObject indicator)
     994        throws ConditionThrowable
     995    {
     996        LispObject list = symbol.getPropertyList();
     997        while (list != NIL) {
     998            LispObject obj = list.car();
     999            if (obj.eql(indicator))
     1000                return list.cadr();
     1001            list = list.cddr();
     1002        }
    9971003        return null;
    9981004    }
     
    10021008        throws ConditionThrowable
    10031009    {
    1004         LispObject list = checkList(symbol.getPropertyList());
     1010        LispObject list = symbol.getPropertyList();
    10051011        while (list != NIL) {
    10061012            if (list.car().eql(indicator)) {
Note: See TracChangeset for help on using the changeset viewer.