0.9.6.7:
authorJuho Snellman <jsnell@iki.fi>
Fri, 28 Oct 2005 12:16:24 +0000 (12:16 +0000)
committerJuho Snellman <jsnell@iki.fi>
Fri, 28 Oct 2005 12:16:24 +0000 (12:16 +0000)
Specialize the sequence functions used for newline-handling in
        FD-SOUT for the common cases of SIMPLE-BASE-STRING /
        (SIMPLE-ARRAY CHARACTER).

src/code/fd-stream.lisp
version.lisp-expr

index 945790e..3d6cb0f 100644 (file)
         (end (or end (length (the vector thing)))))
     (declare (fixnum start end))
     (if (stringp thing)
-        (let ((last-newline (and (find #\newline (the simple-string thing)
-                                       :start start :end end)
-                                 ;; FIXME why do we need both calls?
-                                 ;; Is find faster forwards than
-                                 ;; position is backwards?
-                                 (position #\newline (the simple-string thing)
-                                           :from-end t
-                                           :start start
-                                           :end end))))
+        (let ((last-newline
+               (flet ((do-it (string)
+                        (and (find #\newline string :start start :end end)
+                             ;; FIXME why do we need both calls?
+                             ;; Is find faster forwards than
+                             ;; position is backwards?
+                             (position #\newline string
+                                       :from-end t
+                                       :start start
+                                       :end end))))
+                 (declare (inline do-it))
+                 ;; Specialize the common cases
+                 (etypecase thing
+                   (simple-base-string
+                    (do-it (the simple-base-string thing)))
+                   #!+sb-unicode
+                   ((simple-array character)
+                    (do-it (the (simple-array character) thing)))
+                   (string
+                    (do-it thing))))))
           (if (and (typep thing 'base-string)
                    (eq (fd-stream-external-format stream) :latin-1))
               (ecase (fd-stream-buffering stream)
index 14139e9..6ee9836 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.9.6.6"
+"0.9.6.7"