diff --git a/constraint/solver/hint_registry.go b/constraint/solver/hint_registry.go index fa5d44d357..418407fa37 100644 --- a/constraint/solver/hint_registry.go +++ b/constraint/solver/hint_registry.go @@ -2,10 +2,11 @@ package solver import ( "fmt" - "github.com/consensys/gnark/internal/hints" + "maps" "math/big" "sync" + "github.com/consensys/gnark/internal/hints" "github.com/consensys/gnark/logger" ) @@ -60,18 +61,10 @@ func GetRegisteredHints() []Hint { return ret } -func cloneMap[K comparable, V any](src map[K]V) map[K]V { - res := make(map[K]V, len(registry)) - for k, v := range src { - res[k] = v - } - return res -} - func cloneHintRegistry() map[HintID]Hint { registryM.Lock() defer registryM.Unlock() - return cloneMap(registry) + return maps.Clone(registry) } // InvZeroHint computes the value 1/a for the single input a. If a == 0, returns 0.