554325746@qq.com
2019-07-08 9403e8b0eaa628a062d338244cfeb6f88ffe372d
shardmap/shardmap.go
@@ -26,7 +26,7 @@
var Count = make(chan int)
type wfOp func(a, b string) float32
type wfOp func(a []byte, b string) float32
/**
* @param uint8, shardCnt must be pow of two
@@ -78,7 +78,7 @@
}
// modify by long.
func (s *ShardMap) Walk(wf wfOp, cfrom string) ([]byte){
func (s *ShardMap) Walk(wf wfOp, cfrom []byte) ([]byte){
    var wg sync.WaitGroup
    var second float32 
    var buf []byte
@@ -92,7 +92,7 @@
        wg.Add(1)
        
      go func(st *shardItem, fw wfOp, cf string) {
      go func(st *shardItem, fw wfOp, cf []byte) {
            defer wg.Done()
            commonmux.Lock()
         for id, feature := range st.data {