Changeset 5974


Ignore:
Timestamp:
02/25/04 23:12:04 (17 years ago)
Author:
piso
Message:

hashCode()

Location:
trunk/j/src/org/armedbear/lisp
Files:
2 edited

Legend:

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

    r5968 r5974  
    33 *
    44 * Copyright (C) 2002-2004 Peter Graves
    5  * $Id: ComplexString.java,v 1.11 2004-02-25 17:29:17 piso Exp $
     5 * $Id: ComplexString.java,v 1.12 2004-02-25 23:11:23 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    449449    }
    450450
    451     private int cachedHashCode;
    452 
    453451    public int hashCode()
    454452    {
    455         if (cachedHashCode != 0)
    456             return cachedHashCode;
    457453        int hashCode = 0;
    458454        try {
     
    465461            Debug.trace(t);
    466462        }
    467         return cachedHashCode = hashCode;
     463        return hashCode;
    468464    }
    469465}
  • trunk/j/src/org/armedbear/lisp/SimpleString.java

    r5961 r5974  
    33 *
    44 * Copyright (C) 2004 Peter Graves
    5  * $Id: SimpleString.java,v 1.10 2004-02-25 15:44:19 piso Exp $
     5 * $Id: SimpleString.java,v 1.11 2004-02-25 23:12:04 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    352352    }
    353353
    354     private int cachedHashCode;
    355 
    356354    public int hashCode()
    357355    {
    358         if (cachedHashCode != 0)
    359             return cachedHashCode;
    360356        int hashCode = 0;
    361357        for (int i = 0; i < capacity; i++)
    362358            hashCode = hashCode * 31 + chars[i];
    363         return cachedHashCode = hashCode;
     359        return hashCode;
    364360    }
    365361
Note: See TracChangeset for help on using the changeset viewer.