chiark / gitweb /
basic/strv: use SWAP_TWO() macro (#3602)
author0xAX <0xAX@users.noreply.github.com>
Sun, 26 Jun 2016 10:37:00 +0000 (13:37 +0300)
committerSven Eden <yamakuzure@gmx.net>
Fri, 16 Jun 2017 08:13:01 +0000 (10:13 +0200)
src/basic/strv.c

index 93bb130..ba4d697 100644 (file)
@@ -817,11 +817,7 @@ char **strv_reverse(char **l) {
                 return l;
 
         for (i = 0; i < n / 2; i++) {
-                char *t;
-
-                t = l[i];
-                l[i] = l[n-1-i];
-                l[n-1-i] = t;
+                SWAP_TWO(l[i], l[n-1-i]);
         }
 
         return l;