EXAMINE: Avoid useless call to casereader_count_cases().
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 25 Sep 2012 22:51:07 +0000 (15:51 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Wed, 26 Sep 2012 04:20:51 +0000 (21:20 -0700)
The return value is never used, and this call could have significant
expense (it could cause the data to be read an extra time), so do not
do it.

Reported by GCC 4.7.

src/language/stats/examine.c

index 46b27f9d360ac34b1161a69de910aadb18eaba43..0d9c68585a86a3f19f42bd990001559a39eda84b 100644 (file)
@@ -1596,7 +1596,6 @@ calculate_n (const void *aux1, void *aux2 UNUSED, void *user_data)
       double imax = es[v].cc;
       struct casereader *reader;
       struct ccase *c;
-      casenumber total_cases;
 
       if (examine->histogram)
         {
@@ -1610,7 +1609,6 @@ calculate_n (const void *aux1, void *aux2 UNUSED, void *user_data)
         }
 
       es[v].sorted_reader = casewriter_make_reader (es[v].sorted_writer);
-      total_cases = casereader_count_cases (es[v].sorted_reader);
       es[v].sorted_writer = NULL;
 
       es[v].maxima = pool_calloc (examine->pool, examine->calc_extremes, sizeof (*es[v].maxima));