diff options
author | René Scharfe <l.s.r@web.de> | 2017-01-28 22:40:58 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-01-30 14:17:00 -0800 |
commit | 35d803bc9a0d21c36b1381f6e42455beeb73b715 (patch) | |
tree | 045fa1fa1b75d7477bcd6e49f9ea2a75a9211732 /strbuf.h | |
parent | db101991414f4e14b3763b4843dddcca6b31b40b (diff) | |
download | git-35d803bc9a0d21c36b1381f6e42455beeb73b715.tar.gz |
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 <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.h')
-rw-r--r-- | strbuf.h | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -109,9 +109,7 @@ extern void strbuf_attach(struct strbuf *, void *, size_t, size_t); */ static inline void strbuf_swap(struct strbuf *a, struct strbuf *b) { - struct strbuf tmp = *a; - *a = *b; - *b = tmp; + SWAP(*a, *b); } |