提交 73ad179b 编写于 作者: S Shawn O. Pearce

git-gui: Use catch rather than array names to check file.

When we reshow the current diff file it can be faster to just fetch
the value from the file_states array than it is to ask for all paths
whose name exactly matches the one we want to show.  This is because
[array names -exact] is O(n) in the number of files.
Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
上级 7f1df79b
......@@ -350,11 +350,11 @@ proc clear_diff {} {
proc reshow_diff {} {
global ui_fname_value ui_status_value file_states
if {$ui_fname_value != {} && [array names file_states \
-exact $ui_fname_value] != {}} {
show_diff $ui_fname_value
} else {
if {$ui_fname_value == {}
|| [catch {set s $file_states($ui_fname_value)}]} {
clear_diff
} else {
show_diff $ui_fname_value
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册