> Someone wrote: > > In my opinion it is better to alloc directly MAXPATHLEN+1 bytes > when that limit exists without entering the loop and use multiple > reallocations. > > It's best to keep the code simple, all else being equal, > and reduce the number of conditionals.
To keep the code simple we can remove the #ifdef MAXPATHLEN...#endif piece in the HAVE_GETCWD part. In this way we use always the loop both if MAXPATHLEN is defined or not. Anyway, checking for the MAXPATHLEN inside the loop doesn't change the number of switches, if we want to check for the limit I suggest to have the check outside the loop and avoid multiple reallocations. Giuseppe Scrivano _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel