Browse code
fix: misc bugs
Edward Langley authored on 28/08/2022 06:50:31
Showing 2 changed files
Showing 2 changed files
... | ... |
@@ -13,13 +13,15 @@ |
13 | 13 |
(flet ((count-splits (string) |
14 | 14 |
(declare (optimize (speed 3)) |
15 | 15 |
(type simple-string string)) |
16 |
+ (if (= 0 (length string)) |
|
17 |
+ 1 |
|
16 | 18 |
(do* ((x (the array-length 0) (1+ x)) |
17 | 19 |
(cur-char #1=(aref string x) #1#) |
18 | 20 |
(result (the array-length 0) (if (char= cur-char char) |
19 | 21 |
(1+ result) |
20 | 22 |
result))) |
21 | 23 |
((= x (1- (length string))) (1+ result)) |
22 |
- (declare (type array-length result))))) |
|
24 |
+ (declare (type array-length result)))))) |
|
23 | 25 |
(typecase string |
24 | 26 |
((and string (not simple-string)) |
25 | 27 |
(setf string (copy-seq string)))) |