Changeset 4269
- Timestamp:
- 10/09/03 17:38:30 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/lisp/StringFunctions.java
r4268 r4269 3 3 * 4 4 * Copyright (C) 2003 Peter Graves 5 * $Id: StringFunctions.java,v 1. 8 2003-10-09 17:35:31piso Exp $5 * $Id: StringFunctions.java,v 1.9 2003-10-09 17:38:30 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 314 314 int start2 = Fixnum.getInt(args[4]); 315 315 int end2 = Fixnum.getInt(args[5]); 316 int i, j; 317 for (i = start1, j = start2; i < end1 && j < end2; i++, j++) { 316 int i = start1; 317 int j = start2; 318 while (true) { 319 if (i == end1) { 320 // Reached end of string1. 321 return NIL; 322 } 323 if (j == end2) { 324 // Reached end of string2. 325 return new Fixnum(i); 326 } 318 327 char c1 = Utilities.toUpperCase(array1[i]); 319 328 char c2 = Utilities.toUpperCase(array2[j]); 320 if (c1 == c2) 321 continue; 322 if (c1 < c2) 323 return NIL; 324 if (c1 > c2) 325 return new Fixnum(i); 326 } 327 // Strings are equal. 328 return NIL; 329 if (c1 == c2) { 330 ++i; 331 ++j; 332 continue; 333 } 334 if (c1 < c2) 335 return NIL; 336 if (c1 > c2) 337 return new Fixnum(i); 338 } 329 339 } 330 340 };
Note: See TracChangeset
for help on using the changeset viewer.