[Rd] patch for src/main/character.c

Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk at idi.ntnu.no
Wed Jan 21 10:18:50 CET 2009


Attached is a suggested patch for src/main/character.c.  It does not fix
a bug, but rather provides an improvement on the recent extension of
do_grep.

In essence, instead of four occurences of 'invert ^ LOGICAL(ind)[i]'
that accommodate for the option 'invert' added to grep, there is one
occurence of 'LOGICAL(ind)[i] ^= invert' that modifies in-place the
logical vector of matched/unmatched flags.  Having the inversion done in
just one place instead of four locations in the code should make it
simpler to understand, maintain, and further extend the code.

The patch was made based on the src/main/character.c file in
R-devel_2009-01-20.  Patched code was successfully compiled and tested
on 32bit Ubuntu 8.04.

Regards,
Wacek


-- 
-------------------------------------------------------------------------------
Wacek Kusnierczyk, MD PhD

Email: waku at idi.ntnu.no
Phone: +47 73591875, +47 72574609

Department of Computer and Information Science (IDI)
Faculty of Information Technology, Mathematics and Electrical Engineering (IME)
Norwegian University of Science and Technology (NTNU)
Sem Saelands vei 7, 7491 Trondheim, Norway
Room itv303

Bioinformatics & Gene Regulation Group
Department of Cancer Research and Molecular Medicine (IKM)
Faculty of Medicine (DMF)
Norwegian University of Science and Technology (NTNU)
Laboratory Center, Erling Skjalgsons gt. 1, 7030 Trondheim, Norway
Room 231.05.060

-------------------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: character.c.patch
Type: text/x-diff
Size: 1120 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20090121/fede2402/attachment.bin>


More information about the R-devel mailing list