XDCx, core/state: fix unnecessary conversion (unconvert) (#1507)

Co-authored-by: wit <wit765765346@gmail>
This commit is contained in:
wit liu 2025-09-17 08:25:07 +08:00 committed by GitHub
parent b3ae8beb91
commit 6b20f9ad88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 5 deletions

View file

@ -170,7 +170,7 @@ func (o *OrderItem) SetBSON(raw bson.Raw) error {
if decoded.Signature != nil {
o.Signature = &Signature{
V: byte(decoded.Signature.V),
V: decoded.Signature.V,
R: common.HexToHash(decoded.Signature.R),
S: common.HexToHash(decoded.Signature.S),
}

View file

@ -177,7 +177,7 @@ func (l *LendingItem) SetBSON(raw bson.Raw) error {
if decoded.Signature != nil {
l.Signature = &Signature{
V: byte(decoded.Signature.V),
V: decoded.Signature.V,
R: common.HexToHash(decoded.Signature.R),
S: common.HexToHash(decoded.Signature.S),
}

View file

@ -32,9 +32,7 @@ func BenchmarkCutOriginal(b *testing.B) {
func BenchmarkCutsetterFn(b *testing.B) {
value := common.HexToHash("0x01")
cutSetFn := func(r rune) bool {
return int32(r) == int32(0)
}
cutSetFn := func(r rune) bool { return r == 0 }
for i := 0; i < b.N; i++ {
bytes.TrimLeftFunc(value[:], cutSetFn)
}