diff --git a/utils/Felt.go b/utils/Felt.go index 78570fd4..8d00831f 100644 --- a/utils/Felt.go +++ b/utils/Felt.go @@ -40,15 +40,17 @@ func HexToFelt(hex string) (*felt.Felt, error) { // - []*felt.Felt: an array of *felt.Felt objects, or nil if there was // - error: an error if any func HexArrToFelt(hexArr []string) ([]*felt.Felt, error) { - var feltArr []*felt.Felt - for _, hex := range hexArr { - felt, err := HexToFelt(hex) - if err != nil { - return nil, err - } - feltArr = append(feltArr, felt) - } - return feltArr, nil + + feltArr := make([]*felt.Felt, len(hexArr)) + for i, e := range hexArr { + felt, err := HexToFelt(e) + if err != nil { + return nil, err + } + feltArr[i] = felt + } + return feltArr, nil + } // FeltToBigInt converts a Felt value to a *big.Int.