Rob wrote:
> I disagree - rather than adding a sort call and changing the program's
> runtime complexity, can't we just reduce the amount of lines _and_
> duplication like this:
> 
> @@ -89,9 +93,9 @@ entcmp(const void *va, const void *vb)
>         const Entry *a = va, *b = vb;
> 
> -       if(tflag)
> -               return sortorder * (b->mtime - a->mtime);
> -       else
> -               return sortorder * strcmp(a->name, b->name);
> +       return sortorder * (tflag ? b->mtime - a->mtime : strcmp(a->name, 
> b->name));
>  }

I dissagree. This is harder to read and to understand. Also it gets more complex
when we implement further sort methods (size, ...?).

--Markus

Reply via email to