Mercurial > hg > octave-lojdl
changeset 14524:27f028a670b4
avoid nesting sprintf inside calls to error
* splinefit.m: Avoid unnecessary calls to sprintf.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 04 Apr 2012 12:30:00 -0400 |
parents | c541f7addf25 |
children | 624dcb5e978f |
files | scripts/polynomial/splinefit.m |
diffstat | 1 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/polynomial/splinefit.m +++ b/scripts/polynomial/splinefit.m @@ -181,10 +181,10 @@ endif fields = fieldnames (props); for f = 1:numel(fields) - if (! any (strcmp (fields{f}, {"periodic", "robust", "beta", ... - "order", "constraints"}))) - error (sprintf ("%s:invalidproperty", mfilename ()), - sprintf ("""%s"" is not recongizied", fields{f})) + if (! any (strcmp (fields{f}, + {"periodic", "robust", "beta", "order", "constraints"}))) + error ("splinefit:invalidproperty", + "unrecognized property '%s'", fields{f}); endif endfor args = {}; @@ -198,15 +198,14 @@ if (0 < props.beta && props.beta < 1) args{end+1} = props.beta; else - error (sprintf ("%s:invalidbeta", mfilename), - "Invalid beta parameter (0 < beta < 1)") + error ("splinefit:invalidbeta", "invalid beta parameter (0 < beta < 1)"); endif endif if (isfield (props, "order")) if (props.order >= 0) args{end+1} = props.order + 1; else - error (sprintf ("%s:invalidorder", mfilename), "Invalid order") + error ("splinefit:invalidorder", "invalid order"); endif endif if (isfield (props, "constraints"))