Skip to content

Commit 04d4bdc

Browse files
committed
refactor: simplify bigIntToTwosComplement by removing redundant sign bit check
1 parent e8d4fa1 commit 04d4bdc

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

decimal.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,6 @@ func bigIntToTwosComplement(value *big.Int) ([32]byte, uint8, error) {
173173
buf := [32]byte{}
174174
tmp.FillBytes(buf[:])
175175
offset := 32 - uint8(byteLen)
176-
if buf[offset]&0x80 == 0 {
177-
// Ensure sign bit is set for negative numbers
178-
buf[offset-1] = 0xFF
179-
offset--
180-
}
181176

182177
return buf, offset, nil
183178
}

0 commit comments

Comments
 (0)