diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-02-10 10:04:43 +0100 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-02-10 10:04:43 +0100 |
| commit | 8de2207a53ca37e39cfba1d9ed6cf6ad4997121a (patch) | |
| tree | c2f010af8505ed72adb9543881aa9255344451a9 | |
| parent | c56b8b23efce35748b11273b189492183fc376e2 (diff) | |
| download | muxer-8de2207a53ca37e39cfba1d9ed6cf6ad4997121a.tar.gz muxer-8de2207a53ca37e39cfba1d9ed6cf6ad4997121a.zip | |
Remove old varint helpers
| -rw-r--r-- | varint.go | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/varint.go b/varint.go deleted file mode 100644 index 923f490..0000000 --- a/varint.go +++ /dev/null @@ -1,38 +0,0 @@ -package binproto - -import "math" - -var ( - n1 = uint64(math.Pow(2, 7)) - n2 = uint64(math.Pow(2, 14)) - n3 = uint64(math.Pow(2, 21)) - n4 = uint64(math.Pow(2, 28)) - n5 = uint64(math.Pow(2, 35)) - n6 = uint64(math.Pow(2, 42)) - n7 = uint64(math.Pow(2, 49)) - n8 = uint64(math.Pow(2, 56)) - n9 = uint64(math.Pow(2, 63)) -) - -func encodingLength(i uint64) int { - if i < n1 { - return 1 - } else if i < n2 { - return 2 - } else if i < n3 { - return 3 - } else if i < n4 { - return 4 - } else if i < n5 { - return 5 - } else if i < n6 { - return 6 - } else if i < n7 { - return 7 - } else if i < n8 { - return 8 - } else if i < n9 { - return 9 - } - return 10 -} |
