use hackage zigzag

This commit is contained in:
Eric Demko 2022-01-31 12:16:12 -05:00
parent f16f2120e3
commit def7f05d8b
2 changed files with 2 additions and 7 deletions

View file

@ -1,6 +1 @@
packages: .
source-repository-package
type: git
location: https://github.com/byteverse/zigzag
tag: 689fc7c852bf029af51333bcfffe3661c3276cf1

View file

@ -156,7 +156,7 @@ import Data.Primitive (ByteArray(..),MutableByteArray(..),PrimArray(..))
import Data.Text.Short (ShortText)
import Data.WideWord (Word128,Word256)
import Data.Word (Word64,Word32,Word16,Word8)
import Data.Word.Zigzag (toZigzag,toZigzag32,toZigzag64)
import Data.Word.Zigzag (toZigzagNative,toZigzag32,toZigzag64)
import Foreign.C.String (CStringLen)
import GHC.ByteOrder (ByteOrder(BigEndian,LittleEndian),targetByteOrder)
import GHC.Exts (Addr#,(*#))
@ -1129,7 +1129,7 @@ c2w = fromIntegral . ord
-- | Encode a signed machine-sized integer with LEB-128. This uses
-- zig-zag encoding.
intLEB128 :: Int -> Builder
intLEB128 = wordLEB128 . toZigzag
intLEB128 = wordLEB128 . toZigzagNative
-- | Encode a 32-bit signed integer with LEB-128. This uses zig-zag encoding.
int32LEB128 :: Int32 -> Builder