Changeset 8006


Ignore:
Timestamp:
10/19/04 02:03:31 (17 years ago)
Author:
piso
Message:

FORMAT.PAREN.4

File:
1 edited

Legend:

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

    r7055 r8006  
    33 *
    44 * Copyright (C) 2004 Peter Graves
    5  * $Id: CapitalizeFirstStream.java,v 1.1 2004-06-08 22:52:10 piso Exp $
     5 * $Id: CapitalizeFirstStream.java,v 1.2 2004-10-19 02:03:31 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    3434    {
    3535        if (virgin) {
    36             c = Utilities.toUpperCase(c);
    37             virgin = false;
     36            if (Character.isLetterOrDigit(c)) {
     37                c = Utilities.toUpperCase(c);
     38                virgin = false;
     39            }
    3840        } else
    3941            c = Utilities.toLowerCase(c);
     
    4345    public void _writeString(String s) throws ConditionThrowable
    4446    {
    45         if (s.length() > 0) {
    46             if (virgin) {
    47                 target._writeChar(Utilities.toUpperCase(s.charAt(0)));
    48                 virgin = false;
    49                 target._writeString(s.substring(1).toLowerCase());
    50             } else
    51                 target._writeString(s.toLowerCase());
    52         }
     47        final int length = s.length();
     48        for (int i = 0; i < length; i++)
     49            _writeChar(s.charAt(i));
    5350    }
    5451
Note: See TracChangeset for help on using the changeset viewer.