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

git-gui: Avoid unnecessary global statements when possible

Running global takes slightly longer than just accessing the variable
via its package name, especially if the variable is just only once in
the procedure, or isn't even used at all in the procedure.  So this is
a minor cleanup for some of our commonly invoked procedures.
Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
上级 a870ddc0
......@@ -154,12 +154,10 @@ proc gitexec {args} {
}
proc reponame {} {
global _reponame
return $_reponame
return $::_reponame
}
proc is_MacOSX {} {
global tcl_platform tk_library
if {[tk windowingsystem] eq {aqua}} {
return 1
}
......@@ -167,17 +165,16 @@ proc is_MacOSX {} {
}
proc is_Windows {} {
global tcl_platform
if {$tcl_platform(platform) eq {windows}} {
if {$::tcl_platform(platform) eq {windows}} {
return 1
}
return 0
}
proc is_Cygwin {} {
global tcl_platform _iscygwin
global _iscygwin
if {$_iscygwin eq {}} {
if {$tcl_platform(platform) eq {windows}} {
if {$::tcl_platform(platform) eq {windows}} {
if {[catch {set p [exec cygpath --windir]} err]} {
set _iscygwin 0
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册