refactoring code

git-svn-id: https://weed-fs.googlecode.com/svn/trunk@24 282b0af5-e82d-9cf1-ede4-77906d7719d0
This commit is contained in:
chris.lu@gmail.com
2011-12-25 05:30:57 +00:00
parent 6813f118d4
commit ae3a53388f
7 changed files with 56 additions and 61 deletions

View File

@@ -6,6 +6,7 @@ import (
"storage"
"strconv"
"strings"
"util"
)
type FileId struct {
@@ -30,8 +31,8 @@ func ParseFileId(fid string) *FileId {
}
func (n *FileId) String() string {
bytes := make([]byte, 12)
storage.Uint64toBytes(bytes[0:8], n.Key)
storage.Uint32toBytes(bytes[8:12], n.Hashcode)
util.Uint64toBytes(bytes[0:8], n.Key)
util.Uint32toBytes(bytes[8:12], n.Hashcode)
nonzero_index := 0
for ; bytes[nonzero_index] == 0; nonzero_index++ {
}