use hackage zigzag
This commit is contained in:
parent
f16f2120e3
commit
def7f05d8b
2 changed files with 2 additions and 7 deletions
|
@ -1,6 +1 @@
|
||||||
packages: .
|
packages: .
|
||||||
|
|
||||||
source-repository-package
|
|
||||||
type: git
|
|
||||||
location: https://github.com/byteverse/zigzag
|
|
||||||
tag: 689fc7c852bf029af51333bcfffe3661c3276cf1
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ import Data.Primitive (ByteArray(..),MutableByteArray(..),PrimArray(..))
|
||||||
import Data.Text.Short (ShortText)
|
import Data.Text.Short (ShortText)
|
||||||
import Data.WideWord (Word128,Word256)
|
import Data.WideWord (Word128,Word256)
|
||||||
import Data.Word (Word64,Word32,Word16,Word8)
|
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 Foreign.C.String (CStringLen)
|
||||||
import GHC.ByteOrder (ByteOrder(BigEndian,LittleEndian),targetByteOrder)
|
import GHC.ByteOrder (ByteOrder(BigEndian,LittleEndian),targetByteOrder)
|
||||||
import GHC.Exts (Addr#,(*#))
|
import GHC.Exts (Addr#,(*#))
|
||||||
|
@ -1129,7 +1129,7 @@ c2w = fromIntegral . ord
|
||||||
-- | Encode a signed machine-sized integer with LEB-128. This uses
|
-- | Encode a signed machine-sized integer with LEB-128. This uses
|
||||||
-- zig-zag encoding.
|
-- zig-zag encoding.
|
||||||
intLEB128 :: Int -> Builder
|
intLEB128 :: Int -> Builder
|
||||||
intLEB128 = wordLEB128 . toZigzag
|
intLEB128 = wordLEB128 . toZigzagNative
|
||||||
|
|
||||||
-- | Encode a 32-bit signed integer with LEB-128. This uses zig-zag encoding.
|
-- | Encode a 32-bit signed integer with LEB-128. This uses zig-zag encoding.
|
||||||
int32LEB128 :: Int32 -> Builder
|
int32LEB128 :: Int32 -> Builder
|
||||||
|
|
Loading…
Reference in a new issue