Skip to content

Commit 0e94768

Browse files
committed
reduce code size....
1 parent a6a267b commit 0e94768

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/dash/DashMetrics.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,17 +203,11 @@ function DashMetrics(config) {
203203

204204
const list = metrics[metricName];
205205

206-
if (!list) {
206+
if (!list || list.length <= 0) {
207207
return null;
208208
}
209209

210-
const length = list.length;
211-
212-
if (length <= 0) {
213-
return null;
214-
}
215-
216-
return list[length - 1];
210+
return list[list.length - 1];
217211
}
218212

219213
/**

0 commit comments

Comments
 (0)