~edwargix/tallyard

175525230ac46917d0203eb9a3bb6b13d40fa828 — David Florness 4 years ago 042450f
Use two dimensional array instead of map of maps

I must've been tired when I wrote the original.
1 files changed, 2 insertions(+), 4 deletions(-)

M election/voter.go
M election/voter.go => election/voter.go +2 -4
@@ 307,13 307,11 @@ func printResults(result []byte, candidates []Candidate) {
		}
		return y
	}
	p := make(map[int]map[int]int)
	p := make([][]int, len(candidates))
	for i := range candidates {
		p[i] = make([]int, len(candidates))
		for j := range candidates {
			if i != j {
				if p[i] == nil {
					p[i] = make(map[int]int)
				}
				if result[i*n+j] > result[j*n+i] {
					p[i][j] = int(result[i*n+j])
				} else {