monotone

monotone Commit Details

Date:2011-11-11 20:37:24 (4 years 9 months ago)
Author:Richard Hopkins
Branch:net.venge.monotone
Commit:a9d1085eb0df7cc8a49d22fbf80d4209cbca564d
Parents: 8ff9be8a9b6534d3c362b61258d724809d1e62e7
Message:Use const_iterator instead of iterator for regex_cache

find() and end() are only used to see if an entry exists in the cache, and
have no need to modify the results.
Changes:
Msrc/pcrewrap.cc (3 diffs)

File differences

src/pcrewrap.cc
8080
8181
8282
83
83
8484
8585
8686
......
9292
9393
9494
95
95
9696
9797
9898
......
122122
123123
124124
125
125
126126
127127
128128
class regex_cache_manager
{
public:
regex_cache::iterator find(char const * pattern)
regex_cache::const_iterator find(char const * pattern)
{
return cache.find(pattern);
}
cache[pattern] = data;
}
regex_cache::iterator end()
regex_cache::const_iterator end()
{
return cache.end();
}
int erroff;
char const * err;
// use the cached data if we have it
regex_cache::iterator iter = compiled.find(pattern);
regex_cache::const_iterator iter = compiled.find(pattern);
if (iter != compiled.end())
{
basedat = iter->second.first;

Archive Download the corresponding diff file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status