[PATCH 2/3] diff_scoreopt_parse(): use skip_prefix_if_present()

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

 



Whenever skip_prefix_defval() was called, opt was still equal to
*opt_p.  So we can use skip_prefix_if_present() instead.

Signed-off-by: Michael Haggerty <mhagger@xxxxxxxxxxxx>
---
 diff.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/diff.c b/diff.c
index d629cc5..a07fe9d 100644
--- a/diff.c
+++ b/diff.c
@@ -3890,13 +3890,13 @@ static int diff_scoreopt_parse(const char **opt_p)
 	*opt_p = opt;
 	if (cmd == '-') {
 		/* convert the long-form arguments into short-form versions */
-		if ((opt = skip_prefix_defval(opt, "break-rewrites", *opt_p)) != *opt_p) {
+		if ((opt = skip_prefix_if_present(opt, "break-rewrites")) != *opt_p) {
 			if (*opt == 0 || *opt++ == '=')
 				cmd = 'B';
-		} else if ((opt = skip_prefix_defval(opt, "find-copies", *opt_p)) != *opt_p) {
+		} else if ((opt = skip_prefix_if_present(opt, "find-copies")) != *opt_p) {
 			if (*opt == 0 || *opt++ == '=')
 				cmd = 'C';
-		} else if ((opt = skip_prefix_defval(opt, "find-renames", *opt_p)) != *opt_p) {
+		} else if ((opt = skip_prefix_if_present(opt, "find-renames")) != *opt_p) {
 			if (*opt == 0 || *opt++ == '=')
 				cmd = 'M';
 		}
-- 
1.8.5.3

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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]