Changeset 4268
- Timestamp:
- 10/09/03 17:35:31 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/StringFunctions.java
r4103 r4268 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: StringFunctions.java,v 1. 7 2003-09-28 16:25:07piso Exp $5 * $Id: StringFunctions.java,v 1.8 2003-10-09 17:35:31 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 272 272 int start2 = Fixnum.getInt(args[4]); 273 273 int end2 = Fixnum.getInt(args[5]); 274 int i, j; 275 for (i = start1, j = start2; i < end1 && j < end2; i++, j++) { 274 int i = start1; 275 int j = start2; 276 while (true) { 277 if (i == end1) { 278 // Reached end of string1. 279 if (j == end2) 280 return NIL; // Strings are identical. 281 return new Fixnum(i); 282 } 283 if (j == end2) { 284 // Reached end of string2. 285 return NIL; 286 } 276 287 char c1 = Utilities.toUpperCase(array1[i]); 277 288 char c2 = Utilities.toUpperCase(array2[j]); 278 if (c1 == c2) 279 continue; 280 if (c1 > c2) 281 return NIL; 282 if (c1 < c2) 283 return new Fixnum(i); 284 } 285 // Strings are equal. 286 return NIL; 289 if (c1 == c2) { 290 ++i; 291 ++j; 292 continue; 293 } 294 if (c1 > c2) 295 return NIL; 296 if (c1 < c2) 297 return new Fixnum(i); 298 } 287 299 } 288 300 };
Note: See TracChangeset
for help on using the changeset viewer.