On Feb 13, 9:06 am, Vincent Foley <
vfo...@gmail.com> wrote:
> Should I add this to the list of issues in the Google Code tracker?
>
No. Those hints were suspect to begin with.
.get returns a byte already, and .getShort a short, so those hints
shouldn't do anything useful.
Similarly, coercing to primitive on return doesn't help much as the
result is always boxed.
The code should have been:
(defn get-byte [#^ByteBuffer buf]
(let [x (int (.get buf))]
(bit-and x 0xff)))
(defn get-short [#^ByteBuffer buf]
(let [x (int (.getShort buf))]
(bit-and x 0xffff))))
but there weren't inline conversions from byte/short/char to int. I've
added them in SVN 1279.
get-byte
"Elapsed time: 13.051 msecs"
get-short
"Elapsed time: 10.747 msecs"
Thanks for the report.
Rich