From 9230d95639ae3af0f45f4caffeb3ea7d6a727892 Mon Sep 17 00:00:00 2001 From: kanno <812137533@qq.com> Date: Tue, 29 Aug 2023 14:12:32 +0800 Subject: [PATCH] chore: docs --- README.md | 2 +- decode.go | 2 +- encode.go | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c4eb193..6926aab 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Bencode -A bencode encode and decode library implement by go. +A bencode encode and decode library implement by go. Better performance and more friendly. - [x] Decode - [x] Encode diff --git a/decode.go b/decode.go index 9afafb7..5145fb2 100644 --- a/decode.go +++ b/decode.go @@ -128,7 +128,7 @@ func (decode *decode) convertSlice() (list []interface{}) { func (decode *decode) convertNumeric() int { step := decode.expect(EndOfType) negative := 1 - // consume all of operate symbol + // consume next operate symbol if decode.at(decode.pos+1) == MinusSign { negative = -1 decode.step() diff --git a/encode.go b/encode.go index dc6a176..13a1f16 100644 --- a/encode.go +++ b/encode.go @@ -12,10 +12,6 @@ import ( "strings" ) -// We accept user pass a interface. I don't want to using generic. -// Will using reflection. Although it will have a performance loss, -// but it worth. - type encode struct { output []byte }