Commit 7ef20da6 authored by Steven Allen's avatar Steven Allen

avoid copying the buffer when deserializing

parent 51623e51
......@@ -21,7 +21,6 @@
package bbloom
import (
"bytes"
"encoding/binary"
"encoding/json"
"errors"
......@@ -268,9 +267,7 @@ func (bl *Bloom) JSONMarshalTS() ([]byte, error) {
func JSONUnmarshal(dbData []byte) *Bloom {
bloomImEx := bloomJSONImExport{}
json.Unmarshal(dbData, &bloomImEx)
buf := bytes.NewBuffer(bloomImEx.FilterSet)
bs := buf.Bytes()
bf := NewWithBoolset(bs, bloomImEx.SetLocs)
bf := NewWithBoolset(bloomImEx.FilterSet, bloomImEx.SetLocs)
return bf
}
......
Markdown is supported
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