All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tokenize.c: Replacing handmade rutin with existing function.
@ 2007-07-19  0:04 ricknu-0
  2007-07-25  4:36 ` Josh Triplett
  0 siblings, 1 reply; 2+ messages in thread
From: ricknu-0 @ 2007-07-19  0:04 UTC (permalink / raw)
  To: linux-sparse

Replace handwritten with existing function.

Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
---
Equal, right?

diff --git a/tokenize.c b/tokenize.c
index fbe4c5a..e72c56e 100644
--- a/tokenize.c
+++ b/tokenize.c
@@ -792,16 +792,9 @@ static struct ident *create_hashed_ident(const char *name,
int len, unsigned lon
 	p = &hash_table[hash];
 	while ((ident = *p) != NULL) {
 		if (ident->len == (unsigned char) len) {
-			const char *n = name;
-			const char *m = ident->name;
-			int l = len;
-			do {
-				if (*n != *m)
-					goto next;
-				n++;
-				m++;
-			} while (--l);
-				
+			if (strncmp(name, ident->name, len) != 0)
+				goto next;
+
 			ident_hit++;
 			return ident;
 		}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] tokenize.c: Replacing handmade rutin with existing function.
  2007-07-19  0:04 [PATCH] tokenize.c: Replacing handmade rutin with existing function ricknu-0
@ 2007-07-25  4:36 ` Josh Triplett
  0 siblings, 0 replies; 2+ messages in thread
From: Josh Triplett @ 2007-07-25  4:36 UTC (permalink / raw)
  To: ricknu-0; +Cc: linux-sparse

[-- Attachment #1: Type: text/plain, Size: 215 bytes --]

ricknu-0@student.ltu.se wrote:
> Replace handwritten with existing function.
> 
> Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
> ---
> Equal, right?

Good catch; applied.

- Josh Triplett



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-25  4:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-19  0:04 [PATCH] tokenize.c: Replacing handmade rutin with existing function ricknu-0
2007-07-25  4:36 ` Josh Triplett

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.