Revert "Merge pull request #284 from thinxer/binary"

This reverts commit 3523ad5239, reversing
changes made to 5d100994b1.
This commit is contained in:
chrislusf
2016-04-10 00:24:22 -07:00
parent 113392bce8
commit b39c384d6d
12 changed files with 117 additions and 123 deletions

View File

@@ -1,12 +1,12 @@
package storage
import (
"encoding/binary"
"log"
"os"
"testing"
"github.com/chrislusf/seaweedfs/go/glog"
"github.com/chrislusf/seaweedfs/go/util"
)
func TestMemoryUsage(t *testing.T) {
@@ -29,9 +29,9 @@ func LoadNewNeedleMap(file *os.File) CompactMap {
}
for count > 0 && e == nil {
for i := 0; i < count; i += 16 {
key := binary.BigEndian.Uint64(bytes[i : i+8])
offset := binary.BigEndian.Uint32(bytes[i+8 : i+12])
size := binary.BigEndian.Uint32(bytes[i+12 : i+16])
key := util.BytesToUint64(bytes[i : i+8])
offset := util.BytesToUint32(bytes[i+8 : i+12])
size := util.BytesToUint32(bytes[i+12 : i+16])
if offset > 0 {
m.Set(Key(key), offset, size)
} else {