소스 검색

Result contiene valores unicos

Guillermo Espinoza 8 년 전
부모
커밋
5f8f505d20
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      statsd/endpoint/mysql/index.js

+ 3 - 1
statsd/endpoint/mysql/index.js

@@ -97,7 +97,9 @@ function search(table)
         if (err)
             throw err;
         _.each(rows, function (ts) {
-            result.push(ts.name);
+            if (result.indexOf(ts.name) === -1) { // Se agregan solo los name que no esten en result
+                result.push(ts.name);
+            }
         });
     });