Skip to content

missed numeric optimizations with type-check #23

Open
@tromey

Description

Consider if json--decode-utf16-surrogates checked the input types:

(defun json--decode-utf-16-surrogates (high low)
  "Return the code point represented by the UTF-16 surrogates HIGH and LOW."
  (cl-check-type high integer)
  (cl-check-type low integer)
  (+ (lsh (- high #xD800) 10) (- low #xDC00) #x10000))

This should compile to some ordinary arithmetic. Instead the compiler emits calls to Fminus, Qlsh, etc.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions