Commit c97ce800 authored by Milot Mirdita's avatar Milot Mirdita
Browse files

TemplateServer: Fix parallel reads

parent edc65626
No related merge requests found
Showing with 1 addition and 3 deletions
+1 -3
......@@ -2,7 +2,6 @@ package main
import (
"bufio"
"io"
"math"
"os"
"sort"
......@@ -90,10 +89,9 @@ func (d *Reader) Data(id int64) string {
if id < 0 || id >= d.Size() {
return ""
}
d.file.Seek(int64(d.Index[id].Offset), io.SeekStart)
length := d.Index[id].Length - 1
buffer := make([]byte, length)
d.file.Read(buffer)
d.file.ReadAt(buffer, int64(d.Index[id].Offset))
return string(buffer[:length])
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment