mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
git wrapper: Make while loop more reader-friendly
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>
This commit is contained in:
parent
3827210b91
commit
cca1704897
5
git.c
5
git.c
|
@ -428,9 +428,8 @@ int main(int argc, const char **argv)
|
||||||
* name, and the dirname as the default exec_path
|
* name, and the dirname as the default exec_path
|
||||||
* if we don't have anything better.
|
* if we don't have anything better.
|
||||||
*/
|
*/
|
||||||
do
|
while (cmd <= slash && !is_dir_sep(*slash))
|
||||||
--slash;
|
slash--;
|
||||||
while (cmd <= slash && !is_dir_sep(*slash));
|
|
||||||
if (cmd <= slash) {
|
if (cmd <= slash) {
|
||||||
*slash++ = 0;
|
*slash++ = 0;
|
||||||
git_set_argv0_path(cmd);
|
git_set_argv0_path(cmd);
|
||||||
|
|
Loading…
Reference in a new issue