On 7/1/17 5:50 PM, Matthew Persico wrote: > Greetings! > > I have finally gotten around to working on autoload again to ensure that > there are no issues. But I have a question about the _AUTOLOADS array, > which is used to track what has been autoloaded and is the source of > information for the -p command. > > The code executes a linear scan of the array _AUTOLOADS each time it has to > find and element for removal or to make sure it is not about to add a > duplicate entry. This is hardly very efficient. Would it be OK to convert > that to an associative array (hash to us Perlers) indexed on function name? > > I ask before submitting the patch because I am worried about backward > compatibility; I do not know when hashes were added to bash nor do I know > what the policy is about how far back compatibility has to be maintained.
Go ahead and submit the patch; if backwards compatibility is an issue, just name it `autoload.v4'. Associative arrays have been in bash since bash-4.0, which was released in 2009, so including an updated version with future bash distributions should not limit its usefulness. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/