summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3827210)
raw | patch | inline | side by side (parent: 3827210)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Fri, 2 Jan 2009 18:07:52 +0000 (19:07 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 2 Jan 2009 21:19:40 +0000 (13:19 -0800) |
It is not a good practice to prefer performance over readability in
something as performance uncritical as finding the trailing slash
of argv[0].
So avoid head-scratching by making the loop user-readable, and not
hyper-performance-optimized.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
something as performance uncritical as finding the trailing slash
of argv[0].
So avoid head-scratching by making the loop user-readable, and not
hyper-performance-optimized.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git.c | patch | blob | history |
index 940a498962ceb06a1dba85547d61ad62bb81a499..e0d90713584b9743efd8d52e6b5c262d2135908b 100644 (file)
--- a/git.c
+++ b/git.c
* name, and the dirname as the default exec_path
* if we don't have anything better.
*/
- do
- --slash;
- while (cmd <= slash && !is_dir_sep(*slash));
+ while (cmd <= slash && !is_dir_sep(*slash))
+ slash--;
if (cmd <= slash) {
*slash++ = 0;
git_set_argv0_path(cmd);