# HG changeset patch # User Rik # Date 1389739821 28800 # Node ID 1456702a8b24c412700f47bca43f423929fffbb3 # Parent 87381dbbe25ee039e0d10db860cf5b86519758fe what.m: 3X performance boost. Don't display @fname as class unless it is a directory. * what.m: Use readdir rather than dir for 3X performance boost. Check all @filenames with isdir to only include true class directories. diff -r 87381dbbe25e -r 1456702a8b24 scripts/miscellaneous/what.m --- a/scripts/miscellaneous/what.m Tue Jan 14 13:47:20 2014 -0800 +++ b/scripts/miscellaneous/what.m Tue Jan 14 14:50:21 2014 -0800 @@ -45,7 +45,7 @@ d = dtmp; endif - files = dir (d); + files = readdir (d); w.path = d; w.m = cell (0, 1); w.mex = cell (0, 1); @@ -56,7 +56,7 @@ w.classes = cell (0, 1); for i = 1 : length (files) - n = files(i).name; + n = files{i}; ## Ignore . and .. if (strcmp (n, ".") || strcmp (n, "..")) continue; @@ -71,7 +71,7 @@ w.mex{end+1} = n; elseif (strcmp (e, ".mat")) w.mat{end+1} = n; - elseif (strcmp (n(1), "@")) + elseif (strcmp (n(1), "@") && isdir (n)) w.classes{end+1} = n; endif endif