Changeset 1200 for trunk


Ignore:
Timestamp:
Oct 4, 2010, 2:42:10 PM (11 years ago)
Author:
Peter Johansson
Message:

prefer operator+= rather than operator+

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Stats.cc

    r1199 r1200  
    196196    for (std::set<std::string>::const_iterator iter(authors().begin());
    197197         iter!=authors().end(); ++iter) {
    198       // FIXME: we should uer operator+=
    199       const SumVector& code = code_stats()[*iter];
    200       const SumVector& comments = comment_stats()[*iter];
    201       const SumVector& other = other_stats()[*iter];
    202       const SumVector& copy = copyright_stats()[*iter];
    203 
    204       total_stats()[*iter] = code + comments + other + copy;
    205       assert(total_stats()[*iter][100] ==
    206              code[100]+comments[100]+other[100]+copy[100]);
    207     }
    208 
     198      SumVector& total = total_stats()[*iter];
     199      total = code_stats()[*iter];
     200      total += comment_stats()[*iter];
     201      total += other_stats()[*iter];
     202      total += copyright_stats()[*iter];
     203    }
    209204  }
    210205
Note: See TracChangeset for help on using the changeset viewer.