git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: [PATCH] gitweb: Use File::Find::find in git_get_projects_list
Date: Thu, 14 Sep 2006 20:43:29 +0200	[thread overview]
Message-ID: <eec7rp$vjd$1@sea.gmane.org> (raw)
In-Reply-To: 7vbqpi47vi.fsf@assigned-by-dhcp.cox.net

Junio C Hamano wrote:

> Side note:
> 
> While
> 
>       return unless -d $_
> 
> there is definitely more correct than "return unless -d _" which
> is not, it is not the most efficient.  Because you use fast_xxx,
> you know the last stat was lstat so "-d _" would be true if the
> thing you are looking at is a real directory and will be a
> zero-cost operation.  The only case you want to be careful is a
> symlink pointing at a directory, so
> 
>       return unless ((-d _) || (-l _ && -d $_))
> 
> would be more efficient.
> 
> I have a strange suspicion that Merlyn will soon join us with
> more expertise if we keep talking about Perl ;-)

Truth to be told, I didn't know about '-d _', and File::Find(3pm) 
does talk only about $_.

Besides, I guess that the possible speedup is negligible, and of 
course depend if for example the whole $projectroot aka. $projects_list
is for example populated by symlinks. Then it would be slower.

This is the place where more readable should win.
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

  reply	other threads:[~2006-09-14 18:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-14  6:39 [PATCH] gitweb: Use File::Find::find in git_get_projects_list Jakub Narebski
2006-09-14  7:37 ` Junio C Hamano
2006-09-14  7:59   ` Jakub Narebski
2006-09-14  9:23     ` Junio C Hamano
2006-09-14 18:32       ` Junio C Hamano
2006-09-14 18:43         ` Jakub Narebski [this message]
2006-09-14  9:40     ` Junio C Hamano
2006-09-14 10:01       ` Jakub Narebski
2006-09-14 16:42         ` Junio C Hamano
2006-09-14 17:02           ` Jakub Narebski
2006-09-14 17:12             ` Randal L. Schwartz
2006-09-14 17:39 ` [PATCH (amend)] " Jakub Narebski
2006-09-14 19:14   ` Jakub Narebski
2006-09-14 19:51     ` Junio C Hamano
2006-09-14 21:50   ` Randal L. Schwartz
2006-09-14 19:34 ` [PATCH (take 3)] " Jakub Narebski
2006-09-14 20:13   ` Junio C Hamano
2006-09-14 20:18     ` [PATCH (take 4)] " Jakub Narebski
2006-09-14 20:24       ` Jakub Narebski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='eec7rp$vjd$1@sea.gmane.org' \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).