git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Couder <chriscool@tuxfamily.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Avery Pennarun <apenwarr@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Jonathan Nieder <jrnieder@gmail.com>, Jeff King <peff@peff.net>,
	Max Horn <max@quendi.de>, Andreas Ericsson <ae@op5.se>
Subject: [PATCH v2 86/86] strbuf: remove prefixcmp() as it has been replaced with starts_with()
Date: Sun, 17 Nov 2013 23:07:18 +0100	[thread overview]
Message-ID: <20131117220719.4386.4388.chriscool@tuxfamily.org> (raw)
In-Reply-To: <20131117215732.4386.19345.chriscool@tuxfamily.org>

prefixcmp() is now useless as the previous commit replaced it
everywhere with starts_with(). So let's now remove it.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
---
 git-compat-util.h | 1 -
 strbuf.c          | 9 ---------
 2 files changed, 10 deletions(-)

diff --git a/git-compat-util.h b/git-compat-util.h
index e441a6b..c4c01e7 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -350,7 +350,6 @@ extern void set_die_routine(NORETURN_PTR void (*routine)(const char *err, va_lis
 extern void set_error_routine(void (*routine)(const char *err, va_list params));
 extern void set_die_is_recursing_routine(int (*routine)(void));
 
-extern int prefixcmp(const char *str, const char *prefix);
 extern int starts_with(const char *str, const char *prefix);
 extern int ends_with(const char *str, const char *suffix);
 
diff --git a/strbuf.c b/strbuf.c
index 933d998..ee96dcf 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -1,15 +1,6 @@
 #include "cache.h"
 #include "refs.h"
 
-int prefixcmp(const char *str, const char *prefix)
-{
-	for (; ; str++, prefix++)
-		if (!*prefix)
-			return 0;
-		else if (*str != *prefix)
-			return (unsigned char)*prefix - (unsigned char)*str;
-}
-
 int starts_with(const char *str, const char *prefix)
 {
 	for (; ; str++, prefix++)
-- 
1.8.4.1.561.g12affca

      parent reply	other threads:[~2013-11-19 21:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-17 22:05 [PATCH v2 00/86] replace prefixcmp() with starts_with() Christian Couder
2013-11-17 22:05 ` [PATCH v2 01/86] strbuf: add starts_with() to be used instead of prefixcmp() Christian Couder
2013-11-17 22:05 ` [PATCH v2 02/86] diff: replace prefixcmp() with starts_with() Christian Couder
2013-11-17 22:06 ` [PATCH v2 08/86] transport*: " Christian Couder
2013-11-17 22:06 ` [PATCH v2 40/86] environment: " Christian Couder
2013-11-17 22:07 ` Christian Couder [this message]

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=20131117220719.4386.4388.chriscool@tuxfamily.org \
    --to=chriscool@tuxfamily.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=ae@op5.se \
    --cc=apenwarr@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=max@quendi.de \
    --cc=peff@peff.net \
    /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).