Mercurial > hg > octave-lyh
diff scripts/strings/strcat.m @ 12931:cefd568ea073
Replace function handles with function names in cellfun calls for 15% speedup.
* accumarray.m arrayfun.m, blkdiag.m, cell2mat.m, common_size.m, interp3.m,
interpn.m, __isequal__.m, structfun.m, voronoi.m, strread.m, fullfile.m,
getfield.m, __xzip__.m, setfield.m, what.m, pkg.m, axis.m, pareto.m,
__ghostscript__.m, __go_draw_axes__.m, __patch__.m, refreshdata.m, whitebg.m,
lcm.m, index.m, strcat.m, strmatch.m, validatestring.m: Replace function
handles in calls to cellfun with double quoted function names.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 06 Aug 2011 18:03:18 -0700 |
parents | fd0a3ac60b0e |
children | 72c96de7a403 |
line wrap: on
line diff
--- a/scripts/strings/strcat.m +++ b/scripts/strings/strcat.m @@ -61,14 +61,14 @@ elseif (nargin > 1) ## Convert to cells of strings uo = "uniformoutput"; - reals = cellfun (@isreal, varargin); + reals = cellfun ("isreal", varargin); if (any (reals)) - varargin(reals) = cellfun (@char, varargin(reals), uo, false); + varargin(reals) = cellfun ("char", varargin(reals), uo, false); endif - chars = cellfun (@ischar, varargin); + chars = cellfun ("isclass", varargin, "char"); allchar = all (chars); - varargin(chars) = cellfun (@cellstr, varargin(chars), uo, false); - if (! all (cellfun (@iscell, varargin))) + varargin(chars) = cellfun ("cellstr", varargin(chars), uo, false); + if (! all (cellfun ("isclass", varargin, "cell"))) error ("strcat: inputs must be strings or cells of strings"); endif @@ -81,7 +81,7 @@ endif ## Cellfun handles everything for us. - st = cellfun (@horzcat, varargin{:}, uo, false); + st = cellfun ("horzcat", varargin{:}, uo, false); if (allchar) ## If all inputs were strings, return strings.