Mercurial > hg > octave-lyh
comparison scripts/strings/strmatch.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 | c792872f8942 |
children | a499469b05a4 |
comparison
equal
deleted
inserted
replaced
12930:7bd29d875af1 | 12931:cefd568ea073 |
---|---|
69 else | 69 else |
70 idx = find (strcmp (s, A)); | 70 idx = find (strcmp (s, A)); |
71 endif | 71 endif |
72 if (exact) | 72 if (exact) |
73 ## We can't just use strcmp, because we need to ignore whitespace. | 73 ## We can't just use strcmp, because we need to ignore whitespace. |
74 B = cellfun (@strtrimr, A(idx), "uniformoutput", false); | 74 B = cellfun ("strtrimr", A(idx), "uniformoutput", false); |
75 idx = idx (strcmp (s, B)); | 75 idx = idx (strcmp (s, B)); |
76 endif | 76 endif |
77 elseif (ischar (A)) | 77 elseif (ischar (A)) |
78 [nr, nc] = size (A); | 78 [nr, nc] = size (A); |
79 if (len > nc) | 79 if (len > nc) |