From 1651359ffbda4c14eaf4e79b6deced4f2c247686 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 24 Oct 2007 18:35:41 +0100 Subject: [PATCH] [cairo-perf-diff-files] Only use a valid initializer for min_test. Do not assume that the tests[0] is a valid test, but instead scan for the first test that has a name (i.e. is not a terminator). --- perf/cairo-perf-diff-files.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/perf/cairo-perf-diff-files.c b/perf/cairo-perf-diff-files.c index 05e3fa3bd..5fdf72d42 100644 --- a/perf/cairo-perf-diff-files.c +++ b/perf/cairo-perf-diff-files.c @@ -644,8 +644,13 @@ cairo_perf_reports_compare (cairo_perf_report_t *reports, /* Find the minimum of all current tests, (we have to do this * in case some reports don't have a particular test). */ - min_test = tests[0]; - for (i = 1; i < num_reports; i++) { + for (i = 0; i < num_reports; i++) { + if (tests[i]->name) { + min_test = tests[i]; + break; + } + } + for (++i; i < num_reports; i++) { if (tests[i]->name && test_report_cmp_backend_then_name (tests[i], min_test) < 0) {