mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 21:26:42 +00:00
hashdb, catalyst: Use reflect.TypeFor
This commit is contained in:
parent
27d4a10185
commit
126717cadf
2 changed files with 2 additions and 2 deletions
|
|
@ -883,7 +883,7 @@ func (api *ConsensusAPI) checkFork(timestamp uint64, forks ...forks.Fork) bool {
|
||||||
|
|
||||||
// ExchangeCapabilities returns the current methods provided by this node.
|
// ExchangeCapabilities returns the current methods provided by this node.
|
||||||
func (api *ConsensusAPI) ExchangeCapabilities([]string) []string {
|
func (api *ConsensusAPI) ExchangeCapabilities([]string) []string {
|
||||||
valueT := reflect.TypeOf(api)
|
valueT := reflect.TypeFor[*ConsensusAPI]()
|
||||||
caps := make([]string, 0, valueT.NumMethod())
|
caps := make([]string, 0, valueT.NumMethod())
|
||||||
for i := 0; i < valueT.NumMethod(); i++ {
|
for i := 0; i < valueT.NumMethod(); i++ {
|
||||||
name := []rune(valueT.Method(i).Name)
|
name := []rune(valueT.Method(i).Name)
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ type cachedNode struct {
|
||||||
// cachedNodeSize is the raw size of a cachedNode data structure without any
|
// cachedNodeSize is the raw size of a cachedNode data structure without any
|
||||||
// node data included. It's an approximate size, but should be a lot better
|
// node data included. It's an approximate size, but should be a lot better
|
||||||
// than not counting them.
|
// than not counting them.
|
||||||
var cachedNodeSize = int(reflect.TypeOf(cachedNode{}).Size())
|
var cachedNodeSize = int(reflect.TypeFor[cachedNode]().Size())
|
||||||
|
|
||||||
// forChildren invokes the callback for all the tracked children of this node,
|
// forChildren invokes the callback for all the tracked children of this node,
|
||||||
// both the implicit ones from inside the node as well as the explicit ones
|
// both the implicit ones from inside the node as well as the explicit ones
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue