Mercurial > hg > octave-nkf
changeset 11261:9c19b450b254
strchr.m: style fixes
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 17 Nov 2010 04:15:44 -0500 |
parents | fd18ba11af57 |
children | 4a84b9547f26 |
files | scripts/ChangeLog scripts/strings/strchr.m |
diffstat | 2 files changed, 13 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -2,6 +2,10 @@ * strings/strchr.m: New tests. +2010-11-17 John W. Eaton <jwe@octave.org> + + * strings/strchr.m: Style fixes. + 2010-11-16 Ben Abbott <bpabbott@mac.com> * miscellaneous/unimplemented.m: Update unimplemented functions list.
--- a/scripts/strings/strchr.m +++ b/scripts/strings/strchr.m @@ -20,10 +20,9 @@ ## @deftypefn {Function File} {@var{idx} =} strchr (@var{str}, @var{chars}) ## @deftypefnx {Function File} {@var{idx} =} strchr (@var{str}, @var{chars}, @var{n}) ## @deftypefnx {Function File} {@var{idx} =} strchr (@var{str}, @var{chars}, @var{n}, @var{direction}) -## Search for the string @var{str} for occurrences of characters from the set -## @var{chars}. -## The return value, as well as the @var{n} and @var{direction} arguments behave -## identically as in @code{find}. +## Search for the string @var{str} for occurrences of characters from +## the set @var{chars}. The return value, as well as the @var{n} and +## @var{direction} arguments behave identically as in @code{find}. ## ## This will be faster than using regexp in most cases. ## @@ -44,12 +43,14 @@ mask |= str == chars(i); endfor else - ## Index the str into a mask of valid values. This is slower than it could be - ## because of the +1 issue. + ## Index the str into a mask of valid values. This is slower than + ## it could be because of the +1 issue. f = false (1, 256); f(chars + 1) = true; - si = uint32 (str); # default goes via double - unnecessarily long. - ++si; # in-place + ## Default goes via double -- unnecessarily long. + si = uint32 (str); + ## in-place + ++si; mask = reshape (f(si), size (str)); endif varargout = cell (1, nargout);