Skip to content

Commit

Permalink
Pre-slice input.
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed Nov 15, 2018
1 parent 454fd91 commit 278ba25
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reedsolomon.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,12 @@ func (r reedSolomon) codeSomeShardsP(matrixRows, inputs, outputs [][]byte, outpu
wg.Add(1)
go func(start, stop int) {
for c := 0; c < r.DataShards; c++ {
in := inputs[c]
in := inputs[c][start:stop]
for iRow := 0; iRow < outputCount; iRow++ {
if c == 0 {
galMulSlice(matrixRows[iRow][c], in[start:stop], outputs[iRow][start:stop], r.o.useSSSE3, r.o.useAVX2)
galMulSlice(matrixRows[iRow][c], in, outputs[iRow][start:stop], r.o.useSSSE3, r.o.useAVX2)
} else {
galMulSliceXor(matrixRows[iRow][c], in[start:stop], outputs[iRow][start:stop], r.o.useSSSE3, r.o.useAVX2)
galMulSliceXor(matrixRows[iRow][c], in, outputs[iRow][start:stop], r.o.useSSSE3, r.o.useAVX2)
}
}
}
Expand Down

0 comments on commit 278ba25

Please sign in to comment.