Thread (14 messages) flat view 14 messages, 5 authors, 2016-06-15

Re: [PATCH] Optimize prefixcmp()

From: Marco Costalba <hidden>
Date: 2016-06-15 22:44:01

On Dec 30, 2007 3:50 PM, Marco Costalba [off-list ref] wrote:
If *prefix == "" case is to be considered I vote for your/Johannes
version because it's "better code" (tm).
Ok this is fast and correct

static inline int prefixcmp(const char *str, const char *prefix)
{
	while (*str == *prefix && *prefix)
    		str++, prefix++;

	return (*prefix ? *(unsigned const char *)prefix - *(unsigned const
char *)str : 0);
}


This is the last one, I promise ;-)

Marco
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help