From 0c18fc145da84247b2337ac1d4c0eb19d3884a70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ho=CC=88gborg?= Date: Fri, 17 Jul 2015 23:47:39 +0200 Subject: [PATCH] switched from splitting the string block to splitting bytes and converting lines --- internal/gopow/table.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/gopow/table.go b/internal/gopow/table.go index 46fc3c0..eb46778 100644 --- a/internal/gopow/table.go +++ b/internal/gopow/table.go @@ -1,6 +1,7 @@ package gopow import ( + "bytes" "image" "image/color" "io/ioutil" @@ -72,14 +73,13 @@ func (t *TableComplex) parseBuffer(filebuffer []byte) []*LineComplex { t.Max = float64(math.MaxFloat64 * -1) t.Min = float64(math.MaxFloat64) - block := string(filebuffer) - lines := strings.Split(block, "\n") + lines := bytes.Split(filebuffer, []byte("\n")) table := map[string][]*LineComplex{} for _, l := range lines { - cells := strings.Split(l, ",") + cells := strings.Split(string(l), ",") line := NewLineComplex(cells) if table[line.Hash] == nil { @@ -176,7 +176,6 @@ func (t *TableComplex) IntegrateLines(lines []*LineComplex) *LineComplex { if i > 0 { masterline.AddSamples(l) } - } return masterline