]> git.pond.sub.org Git - empserver/commitdiff
Simplify head_meanwhile()
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 8 Jan 2013 17:02:07 +0000 (18:02 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 12 Jan 2013 16:56:39 +0000 (17:56 +0100)
No functional change.

src/lib/commands/head.c

index 1f85f702fed5bd8d9cd2d9912937d2acbedbf977..67e8fbcb10586b176348768ac4977d409a9622a8 100644 (file)
@@ -137,18 +137,10 @@ head_printscoop(struct histstr (*hist)[MAXNOC], natid ano, natid vno)
 static char *
 head_meanwhile(int val)
 {
-    switch (val & 03) {
-    case 0:
-       return "Meanwhile";
-    case 1:
-       return "On the other hand";
-    case 2:
-       return "At the same time";
-    case 3:
-       return "Although";
-    }
-    /*NOTREACHED*/
-    return "";
+    static char *meanwhile[4] = {
+       "Meanwhile", "On the other hand", "At the same time", "Although"
+    };
+    return meanwhile[val % 4];
 }
 
 static void