linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ricknu-0@student.ltu.se
To: linux-sparse@vger.kernel.org
Subject: [PATCH] tokenize.c: Replacing handmade rutin with existing function.
Date: Thu, 19 Jul 2007 02:04:36 +0200	[thread overview]
Message-ID: <1184803476.469eaa94bd1a8@portal.student.luth.se> (raw)

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;
 		}

             reply	other threads:[~2007-07-19  0:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-19  0:04 ricknu-0 [this message]
2007-07-25  4:36 ` [PATCH] tokenize.c: Replacing handmade rutin with existing function Josh Triplett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1184803476.469eaa94bd1a8@portal.student.luth.se \
    --to=ricknu-0@student.ltu.se \
    --cc=linux-sparse@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).