Changeset 1325 for trunk/lib/Graph.cc


Ignore:
Timestamp:
Jan 23, 2011, 8:22:57 AM (10 years ago)
Author:
Peter Johansson
Message:

use reverse iterator instead of reversing the range

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Graph.cc

    r1323 r1325  
    150150    PLFLT dy=0.003*yrange_;
    151151    unsigned int row=0;
    152     std::reverse(legend_.begin(), legend_.end());
    153     for (std::vector<legend_data>::const_iterator i=legend_.begin();
    154          i!=legend_.end(); i++, ++row) {
     152    std::vector<legend_data>::const_reverse_iterator end = legend_.rend();
     153    for (std::vector<legend_data>::const_reverse_iterator i=legend_.rbegin();
     154         i!=end; ++i, ++row) {
    155155      PLFLT y=(0.95-0.04*row)*yrange_;
    156156      current_color(*i);
Note: See TracChangeset for help on using the changeset viewer.