mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
XDCx, core/state: fix unnecessary conversion (unconvert) (#1507)
Co-authored-by: wit <wit765765346@gmail>
This commit is contained in:
parent
b3ae8beb91
commit
6b20f9ad88
3 changed files with 3 additions and 5 deletions
|
|
@ -170,7 +170,7 @@ func (o *OrderItem) SetBSON(raw bson.Raw) error {
|
||||||
|
|
||||||
if decoded.Signature != nil {
|
if decoded.Signature != nil {
|
||||||
o.Signature = &Signature{
|
o.Signature = &Signature{
|
||||||
V: byte(decoded.Signature.V),
|
V: decoded.Signature.V,
|
||||||
R: common.HexToHash(decoded.Signature.R),
|
R: common.HexToHash(decoded.Signature.R),
|
||||||
S: common.HexToHash(decoded.Signature.S),
|
S: common.HexToHash(decoded.Signature.S),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,7 @@ func (l *LendingItem) SetBSON(raw bson.Raw) error {
|
||||||
|
|
||||||
if decoded.Signature != nil {
|
if decoded.Signature != nil {
|
||||||
l.Signature = &Signature{
|
l.Signature = &Signature{
|
||||||
V: byte(decoded.Signature.V),
|
V: decoded.Signature.V,
|
||||||
R: common.HexToHash(decoded.Signature.R),
|
R: common.HexToHash(decoded.Signature.R),
|
||||||
S: common.HexToHash(decoded.Signature.S),
|
S: common.HexToHash(decoded.Signature.S),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,7 @@ func BenchmarkCutOriginal(b *testing.B) {
|
||||||
|
|
||||||
func BenchmarkCutsetterFn(b *testing.B) {
|
func BenchmarkCutsetterFn(b *testing.B) {
|
||||||
value := common.HexToHash("0x01")
|
value := common.HexToHash("0x01")
|
||||||
cutSetFn := func(r rune) bool {
|
cutSetFn := func(r rune) bool { return r == 0 }
|
||||||
return int32(r) == int32(0)
|
|
||||||
}
|
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
bytes.TrimLeftFunc(value[:], cutSetFn)
|
bytes.TrimLeftFunc(value[:], cutSetFn)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue