[PATCH] tokenize.c: Replacing handmade rutin with existing function.

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

 



Replace handwritten with existing function.

Signed-off-by: Richard Knutsson <ricknu-0@xxxxxxxxxxxxxx>
---
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;
 		}

-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux