Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: bench/bench_graph_svg.py

Issue 16907003: Fixes zero division when there are no lines to plot (only one revision in range) (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/bench_graph_svg.py
===================================================================
--- bench/bench_graph_svg.py (revision 9529)
+++ bench/bench_graph_svg.py (working copy)
@@ -809,7 +809,11 @@
(global_min_x, _), (global_max_x, global_max_y) = bounds(lines)
max_up_slope, min_down_slope = bounds_slope(regressions)
-
+
+ if global_max_x == global_min_x:
+ # < 2 revisions in the given revision range: no lines to plot
+ return
+
#output
global_min_y = 0
x = global_min_x
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698