go fmt
This commit is contained in:
@@ -249,7 +249,7 @@ func (nl *NameList) DeleteName(name string) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if nextNameBatch != nil && len(nextNameBatch.names) + len(prevNameBatch.names) < nl.batchSize {
|
||||
if nextNameBatch != nil && len(nextNameBatch.names)+len(prevNameBatch.names) < nl.batchSize {
|
||||
// case 3.1 merge nextNode and prevNode
|
||||
if _, err := nl.skipList.DeleteByKey(nextNode.Key); err != nil {
|
||||
return err
|
||||
@@ -300,7 +300,7 @@ func (nl *NameList) ListNames(startFrom string, visitNamesFn func(name string) b
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nl *NameList) RemoteAllListElement() error {
|
||||
@@ -323,4 +323,4 @@ func (nl *NameList) RemoteAllListElement() error {
|
||||
}
|
||||
return nil
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,4 +68,4 @@ func (nl *NameList) ToBytes() []byte {
|
||||
glog.Errorf("marshal skiplist: %v", err)
|
||||
}
|
||||
return data
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ func TestNameList(t *testing.T) {
|
||||
// list.skipList.println()
|
||||
|
||||
deleteBase := 5
|
||||
deleteCount := maxNameCount - 3 * deleteBase
|
||||
deleteCount := maxNameCount - 3*deleteBase
|
||||
|
||||
for i := deleteBase; i < deleteBase+deleteCount; i++ {
|
||||
list.DeleteName(String(i))
|
||||
|
||||
@@ -467,7 +467,7 @@ func (t *SkipList) GetSmallestNode() (*SkipListElement, error) {
|
||||
func (t *SkipList) GetLargestNode() (*SkipListElement, error) {
|
||||
return t.LoadElement(t.EndLevels[0])
|
||||
}
|
||||
func (t *SkipList) GetLargestNodeReference() (*SkipListElementReference) {
|
||||
func (t *SkipList) GetLargestNodeReference() *SkipListElementReference {
|
||||
return t.EndLevels[0]
|
||||
}
|
||||
|
||||
|
||||
@@ -48,4 +48,4 @@ func (ref *SkipListElementReference) IsNil() bool {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ func TestReverseInsert(t *testing.T) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
func TestInsertAndFind(t *testing.T) {
|
||||
|
||||
k0 := []byte("0")
|
||||
|
||||
Reference in New Issue
Block a user