@matheusbsbs / matheus-bagliano / commits / d36cd96837
Fork 0

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: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Jul 19, 2007 at 00:43 UTC d36cd968378cd3e509434b1b9f43f1417fdba57e
1 file changed +4 -7
git-gui.sh
+4 -7
@@ -154,12 +154,10 @@ proc gitexec {args} {
154 }
155
156 proc reponame {} {
157 - global _reponame
158 - return $_reponame
157 + return $::_reponame
158 }
159
160 proc is_MacOSX {} {
162 - global tcl_platform tk_library
161 if {[tk windowingsystem] eq {aqua}} {
162 return 1
163 }
@@ -167,17 +165,16 @@ proc is_MacOSX {} {
165 }
166
167 proc is_Windows {} {
170 - global tcl_platform
171 - if {$tcl_platform(platform) eq {windows}} {
168 + if {$::tcl_platform(platform) eq {windows}} {
169 return 1
170 }
171 return 0
172 }
173
174 proc is_Cygwin {} {
178 - global tcl_platform _iscygwin
175 + global _iscygwin
176 if {$_iscygwin eq {}} {
180 - if {$tcl_platform(platform) eq {windows}} {
177 + if {$::tcl_platform(platform) eq {windows}} {
178 if {[catch {set p [exec cygpath --windir]} err]} {
179 set _iscygwin 0
180 } else {