From 67e43f3175a1e33548442f1c6292d339bc39f12e12055d2b0060256243221b39 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 14 Jan 2025 13:19:54 +0300 Subject: [PATCH] =?utf8?q?Simplify=20=E2=89=A50=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- go/atom-encode.go | 2 +- go/encode.go | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/go/atom-encode.go b/go/atom-encode.go index 485d9b4..4c5876a 100644 --- a/go/atom-encode.go +++ b/go/atom-encode.go @@ -97,7 +97,7 @@ func IntEncode(w io.Writer, v int64) (written int64, err error) { // Write an encoded ±INT atom. func BigIntEncode(w io.Writer, v *big.Int) (written int64, err error) { - if v.Cmp(bigIntZero) >= 0 { + if v.Sign() >= 0 { _, err = w.Write([]byte{byte(AtomPInt)}) } else { n1 := big.NewInt(-1) diff --git a/go/encode.go b/go/encode.go index cd478f1..2f9cf01 100644 --- a/go/encode.go +++ b/go/encode.go @@ -31,8 +31,6 @@ import ( "go.cypherpunks.su/tai64n/v4" ) -var bigIntZero = big.NewInt(0) - type EncodeOpts struct { // Do not convert time.Time to TAI, assume no conversion is needed. LeaveTAI bool -- 2.48.1