# HG changeset patch # User John W. Eaton # Date 1289985344 18000 # Node ID 9c19b450b254f4abda5db5a85faa21c0ca42b561 # Parent fd18ba11af577b57414d8ef6523c3b68062aa4e7 strchr.m: style fixes diff -r fd18ba11af57 -r 9c19b450b254 scripts/ChangeLog --- a/scripts/ChangeLog Wed Nov 17 04:16:59 2010 -0500 +++ b/scripts/ChangeLog Wed Nov 17 04:15:44 2010 -0500 @@ -2,6 +2,10 @@ * strings/strchr.m: New tests. +2010-11-17 John W. Eaton + + * strings/strchr.m: Style fixes. + 2010-11-16 Ben Abbott * miscellaneous/unimplemented.m: Update unimplemented functions list. diff -r fd18ba11af57 -r 9c19b450b254 scripts/strings/strchr.m --- a/scripts/strings/strchr.m Wed Nov 17 04:16:59 2010 -0500 +++ b/scripts/strings/strchr.m Wed Nov 17 04:15:44 2010 -0500 @@ -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);