finally (return elements)))
;; Find the smallest character code such that the corresponding
;; byte is != to the code.
- (lowest-non-equivalent-code (position-if-not #'(lambda (pair)
- (apply #'= pair))
- pairs))
+ (lowest-non-equivalent-code
+ (caar (sort (copy-seq exceptions) #'< :key #'car)))
;; Sort them for our lookup table.
(sorted-pairs (sort (subseq pairs lowest-non-equivalent-code)
#'< :key #'car))
,(make-array 256 :element-type t #+nil 'char-code
:initial-contents (loop for byte below 256
collect
- (let ((exception (cadr (assoc byte exceptions))))
+ (let ((exception (cdr (assoc byte exceptions))))
(if exception
- exception
+ (car exception)
byte)))))
(code-to-byte-table
,(make-array (length sorted-lookup-table)
:check-fill-pointer t)
(declare (type (simple-array (unsigned-byte 8) (*)) vector))
(let ((ef (maybe-defaulted-external-format external-format)))
- (funcall (symbol-function (sb!impl::ef-octets-to-string-sym ef))
- vector start end))))
+ (funcall (sb!impl::ef-octets-to-string-fun ef) vector start end))))
(defun string-to-octets (string &key (external-format :default)
(start 0) end null-terminate)
:check-fill-pointer t)
(declare (type simple-string string))
(let ((ef (maybe-defaulted-external-format external-format)))
- (funcall (symbol-function (sb!impl::ef-string-to-octets-sym ef))
- string start end (if null-terminate 1 0)))))
+ (funcall (sb!impl::ef-string-to-octets-fun ef) string start end
+ (if null-terminate 1 0)))))
#!+sb-unicode
(defvar +unicode-replacement-character+ (string (code-char #xfffd)))