Mercurial > hg
diff mercurial/hgweb/wsgicgi.py @ 20837:191a0ae37767
grep: use "found" instead of "filerevmatches" examination for efficiency
Before this patch, internal function "display()" of "hg grep" stores
whether matching is already found or not into the dictionary
"filerevmatches" by "(fn, rev)" tuple as the key.
But this is redundant, because:
- "filerevmatches" is local variable of "display()", so each
"display()" invocations don't affect others
- both "fn" and "rev" (gotten from "ctx" argument) are never changed
in each "display()" invocations
Then, "filerevmatches" should have only one entry at most, and "(fn,
rev) in filerevmatches" should be equal to "found".
This patch uses "found" instead of "filerevmatches" examination for
efficiency.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sat, 15 Feb 2014 19:54:05 +0900 |
parents | e8efcc8ff5c0 |
children | 37fcfe52c68c |