From 6a413e1d7d485f506e81c669bc692868c29cefb9 Mon Sep 17 00:00:00 2001
From: sunty <1172534965@qq.com>
Date: 星期四, 18 七月 2019 17:37:25 +0800
Subject: [PATCH] fix sdkcompare

---
 shardmap/shardmap.go |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/shardmap/shardmap.go b/shardmap/shardmap.go
index 6e19e48..4868281 100644
--- a/shardmap/shardmap.go
+++ b/shardmap/shardmap.go
@@ -4,8 +4,8 @@
 
 import (
 	"sync"
-    "encoding/json"
-    "fmt"
+    //"encoding/json"
+    //"fmt"
 )
 
 var commonmux sync.Mutex
@@ -78,11 +78,9 @@
 }
 
 // modify by long.
-func (s *ShardMap) Walk(wf wfOp, cfrom []byte) ([]byte){
+func (s *ShardMap) Walk(wf wfOp, cfrom []byte) ( map[string]float32 ){
     var wg sync.WaitGroup
     var second float32 
-    var buf []byte
-    var err error
 
     ids := make(map[string]float32)
 	for _, si := range s.shards {
@@ -110,13 +108,8 @@
 
     wg.Wait()
 
-    buf, err = json.Marshal(ids)
-    if err != nil {
-        fmt.Println("compare json err")
-            buf = nil 
-        
-    }
-    return buf
+    return ids
+
 }
 
 // print all

--
Gitblit v1.8.0