[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] same.c optimization

From: Paul Eggert
Subject: Re: [Bug-gnulib] same.c optimization
Date: 14 Jan 2003 09:36:21 -0800

Bruno Haible <address@hidden> writes:

> Here is a proposed change to same.c. It doesn't change anything of the
> semantics, but it will avoid stat() when not needed, by doing first the
> checks which don't need system calls, and then only the checks which call
> stat(). What do you think?

That sounds like an obvious improvement.  One minor suggestion:

> !       source_dirname = dir_name (source);
> !       dest_dirname = dir_name (dest);

You can replace this with

     char *source_dirname = dir_name (source);
     char *dest_dirname = dir_name (dest);

and remove the outer declarations of source_dirname and dest_dirname,
which will no longer be needed.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]