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') && ....)


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(...)

  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.


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 Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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