From 35d803bc9a0d21c36b1381f6e42455beeb73b715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 28 Jan 2017 22:40:58 +0100 Subject: use SWAP macro Apply the semantic patch swap.cocci to convert hand-rolled swaps to use the macro SWAP. The resulting code is shorter and easier to read, the object code is effectively unchanged. The patch for object.c had to be hand-edited in order to preserve the comment before the change; Coccinelle tried to eat it for some reason. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- line-range.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'line-range.c') diff --git a/line-range.c b/line-range.c index de4e32f942..323399d16c 100644 --- a/line-range.c +++ b/line-range.c @@ -269,8 +269,7 @@ int parse_range_arg(const char *arg, nth_line_fn_t nth_line_cb, return -1; if (*begin && *end && *end < *begin) { - long tmp; - tmp = *end; *end = *begin; *begin = tmp; + SWAP(*end, *begin); } return 0; -- cgit v1.2.3