Re: [xml] RAW && NXT with strncmp()



On Wed, Oct 01, 2003 at 04:44:14PM +0300, Igor Izvarin wrote:
Hi community,
 
I think this is the question mainly to Daniel Veillard, but ... :-)))
 
I found 79 (more or less) places in the parser.c code that contains
fragments like this:
if ((RAW == '<') && (NXT(1) == '?') && (NXT(2) == 'x') && ....)

  Right,

Its functionality is exact repetition of the functionality of the
strncmp() standard function.
if (strncmp(RAW, "<?x...", n) == 0) ...

  if the test is wrong you pay a function call for nothing.

This function can be expanded inline using the #pragma intrinsic(...)
instruction.

  That's not portable, I can't rely on this.

For my opinion this change will improve the code readability and
maintenance, will reduce the source code size and object code size.

  yes,

What is your opinion on this?

  That I was looking at it this yesterday actually but I don't feel
that confident about such a change, yet ...

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]