refactor: implement Order and Pattern types: slices returning default values for out of bound indices

This commit is contained in:
vsariola
2021-05-12 11:31:38 +03:00
parent ce6e5d4942
commit a2723829da
9 changed files with 68 additions and 51 deletions

View File

@ -10,7 +10,7 @@ import (
// fixPatternLength makes sure that every pattern is the same length. During
// composing. Patterns shorter than the given length are padded with 1 / "hold";
// patterns longer than the given length are cropped.
func fixPatternLength(patterns [][]byte, fixedLength int) [][]int {
func fixPatternLength(patterns []sointu.Pattern, fixedLength int) [][]int {
patternData := make([]int, len(patterns)*fixedLength)
ret := make([][]int, len(patterns))
for i, pat := range patterns {