]> asedeno.scripts.mit.edu Git - cl-protobufs.git/commitdiff
wire-format: More type declaration and LOGBITP usage
authorAlejandro R Sedeño <asedeno@google.com>
Mon, 29 Apr 2013 20:04:59 +0000 (16:04 -0400)
committerAlejandro R Sedeño <asedeno@google.com>
Wed, 29 May 2013 22:02:07 +0000 (18:02 -0400)
wire-format.lisp

index 98d2b8dfdf31ca2542eab69aae145ac852cda6d4..ea47e44a45b29795204a07eca1b4e487485703df 100644 (file)
            (type fixnum index))
   (multiple-value-bind (val index)
       (decode-uint64 buffer index)
-    (when (logbitp 63 val)
-      (decf val #.(ash 1 64)))
-    (values val index)))
+    (declare (type (unsigned-byte 64) val))
+    (values (if (logbitp 63 val)
+                (- val #.(ash 1 64))
+                val)
+            index)))
 
 (defun decode-single (buffer index)
   "Decodes the next single float in the buffer at the given index.