github.com/consensys/gnark@v0.11.0/backend/groth16/internal/utils.go (about) 1 package internal 2 3 func ConcatAll(slices ...[]int) []int { // copyright note: written by GitHub Copilot 4 totalLen := 0 5 for _, s := range slices { 6 totalLen += len(s) 7 } 8 res := make([]int, totalLen) 9 i := 0 10 for _, s := range slices { 11 i += copy(res[i:], s) 12 } 13 return res 14 } 15 16 func NbElements(slices [][]int) int { // copyright note: written by GitHub Copilot 17 totalLen := 0 18 for _, s := range slices { 19 totalLen += len(s) 20 } 21 return totalLen 22 }