vi: code shrink
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 8 Jun 2019 10:57:07 +0000 (12:57 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 8 Jun 2019 10:57:07 +0000 (12:57 +0200)
function                                             old     new   delta
colon                                               2852    2846      -6

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
editors/vi.c

index 8af1ef76be4cf04cf0acf980ae1c32eb671caeca..0ea547a75d83e7a1c087bb5f2ff184b64675db98 100644 (file)
@@ -1331,7 +1331,7 @@ static char what_reg(void)
        char c;
 
        c = 'D';                        // default to D-reg
-       if (0 <= YDreg && YDreg <= 25)
+       if (YDreg <= 25)
                c = 'a' + (char) YDreg;
        if (YDreg == 26)
                c = 'D';
@@ -2550,7 +2550,7 @@ static void colon(char *buf)
                        free(reg[Ureg]);        //   free orig line reg- for 'U'
                        reg[Ureg] = NULL;
                }
-               if (YDreg >= 0 && YDreg < 28) {
+               /*if (YDreg < 28) - always true*/ {
                        free(reg[YDreg]);       //   free default yank/delete register
                        reg[YDreg] = NULL;
                }