Changeset 5899


Ignore:
Timestamp:
02/23/04 14:53:42 (17 years ago)
Author:
piso
Message:

STRING-POSITION: removed use of checkString().

File:
1 edited

Legend:

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

    r5897 r5899  
    33 *
    44 * Copyright (C) 2003-2004 Peter Graves
    5  * $Id: StringFunctions.java,v 1.18 2004-02-23 14:24:48 piso Exp $
     5 * $Id: StringFunctions.java,v 1.19 2004-02-23 14:53:42 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    886886        {
    887887            char c = LispCharacter.getValue(first);
    888             LispString string = checkString(second);
     888            AbstractString string;
     889            if (second instanceof AbstractString)
     890                string = (AbstractString) second;
     891            else
     892                return signal(new TypeError(second, Symbol.STRING));
    889893            int start = Fixnum.getValue(third);
    890             char[] chars = string.chars();
    891             for (int i = start, limit = chars.length; i < limit; i++) {
    892                 if (chars[i] == c)
     894            for (int i = start, limit = string.length(); i < limit; i++) {
     895                if (string.getChar(i) == c)
    893896                    return number(i);
    894897            }
Note: See TracChangeset for help on using the changeset viewer.