summaryrefslogtreecommitdiffstats
path: root/src/stat_cache.cc
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-09-10 00:18:28 (GMT)
committerEvan Martin <martine@danga.com>2011-09-10 00:18:43 (GMT)
commit686fd98828e27008ddd0f58b4c180f536168d49c (patch)
treed8e2cbba91614d45dab05d2d3d0b818c1cd900c3 /src/stat_cache.cc
parent50489a5160425bb68d5c57fbaa352a5355c2254b (diff)
downloadNinja-686fd98828e27008ddd0f58b4c180f536168d49c.zip
Ninja-686fd98828e27008ddd0f58b4c180f536168d49c.tar.gz
Ninja-686fd98828e27008ddd0f58b4c180f536168d49c.tar.bz2
change main hash to char*; use pointers into files
This has a small (20ms) effect on Chrome, but it will also be used more as I remove more strings.
Diffstat (limited to 'src/stat_cache.cc')
-rw-r--r--src/stat_cache.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/stat_cache.cc b/src/stat_cache.cc
index bdf20a8..487afd1 100644
--- a/src/stat_cache.cc
+++ b/src/stat_cache.cc
@@ -19,11 +19,12 @@
#include "graph.h"
FileStat* StatCache::GetFile(const std::string& path) {
- Paths::iterator i = paths_.find(path);
+ Key key(path.c_str());
+ Paths::iterator i = paths_.find(key);
if (i != paths_.end())
return i->second;
FileStat* file = new FileStat(path);
- paths_[path] = file;
+ paths_[Key(file->path_.c_str())] = file;
return file;
}