6820da6

Branches > main > 6820da6 > files

Remove unused reader function

Grahp, 2026-07-08

Commit: 6820da622481659fa7fd0336ff78fd3fc760f61e
Parent: ecb0f98

1 changed file:

src/net/bowmap/network/protocol/readers.clj modified (view file)

@@ -11,22 +11,6 @@    [java.nio.charset Charset]    [java.util UUID])) -(defn can-read-packet?-  "Returns whether a varint length can be read from buf, and whether buf has enough bytes to read a full packet.-   Can throw if varint is too long, meaning it is completely invalid."-  [buf]-  (loop [num-read 0-         result 0]-    (if (>= num-read t/max-varint-size)-      (raise "VarInt too long")-      (when (< num-read (ByteBuf/.readableBytes buf))-        (let [b (ByteBuf/.getByte buf (+ (ByteBuf/.readerIndex buf)-                                        num-read))-              result' (bit-or result (bit-shift-left (bit-and b 0x7F) (* 7 num-read)))]-          (if (zero? (bit-and b 0x80))-            (>= (ByteBuf/.readableBytes buf) (+ result' num-read 1))-            (recur (inc num-read) result')))))))- (defn ->varint [buf]   (loop [num-read 0          result 0]