Changeset 231 for trunk/lib


Ignore:
Timestamp:
Mar 25, 2007, 11:49:31 PM (14 years ago)
Author:
Peter Johansson
Message:

minor speed-up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/File.cc

    r230 r231  
    174174
    175175      // find username in map of aliases
    176       map<string, string>::const_iterator name = alias.find(authors[*i]);
     176      map<string, string>::iterator name = alias.lower_bound(authors[*i]);
    177177      // if alias exist insert alias
    178       if (name != alias.end() )
     178      if (name != alias.end() && name->first==authors[*i])
    179179        copyright[timeinfo->tm_year].insert(name->second);
    180180      else {
     
    183183        std::cerr << "Warning: no alias found for `" << authors[*i] << "`\n";
    184184        // insert alias to avoid multiple warnings.
    185         alias[authors[*i]] = authors[*i];
     185        std::string tmp(authors[*i]);
     186        alias.insert(name, std::make_pair(tmp, tmp));
    186187      }
    187188    }
Note: See TracChangeset for help on using the changeset viewer.