浏览代码

drop one level of nesting

ryan 6 年之前
父节点
当前提交
3f44445dd6
共有 1 个文件被更改,包括 19 次插入17 次删除
  1. 19 17
      public/app/plugins/panel/graph2/GraphPanel.tsx

+ 19 - 17
public/app/plugins/panel/graph2/GraphPanel.tsx

@@ -24,23 +24,25 @@ export class GraphPanel extends PureComponent<Props> {
     const vmSeries: TimeSeriesVMs = [];
     for (const table of data) {
       const timeColumn = getFirstTimeColumn(table);
-      if (timeColumn >= 0) {
-        for (let i = 0; i < table.columns.length; i++) {
-          const column = table.columns[i];
-
-          // Show all numeric columns
-          if (column.type === ColumnType.number) {
-            const tsvm = processTimeSeries({
-              data: [table],
-              xColumn: timeColumn,
-              yColumn: i,
-              nullValueMode: NullValueMode.Null,
-            })[0];
-
-            const colorIndex = vmSeries.length % colors.length;
-            tsvm.color = colors[colorIndex];
-            vmSeries.push(tsvm);
-          }
+      if (timeColumn < 0) {
+        continue;
+      }
+
+      for (let i = 0; i < table.columns.length; i++) {
+        const column = table.columns[i];
+
+        // Show all numeric columns
+        if (column.type === ColumnType.number) {
+          const tsvm = processTimeSeries({
+            data: [table],
+            xColumn: timeColumn,
+            yColumn: i,
+            nullValueMode: NullValueMode.Null,
+          })[0];
+
+          const colorIndex = vmSeries.length % colors.length;
+          tsvm.color = colors[colorIndex];
+          vmSeries.push(tsvm);
         }
       }
     }