commit ec9e3b3c22c95e158025a45ace10108c57d77ed2
parent 0b44f0720c8836ce86b98176edfff377de2d3959
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Sat, 12 Dec 2015 21:33:38 +0100
Simplify expression in chkglobal()
This expression is too complex, so it is better to
split it in two expressions inside of an if-else.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ed.c b/ed.c
@@ -1149,7 +1149,10 @@ chkglobal(void)
compile(delim);
for (i = 1; i <= lastln; i = nextln(i)) {
- v = i >= line1 && i <= line2 && match(i, 0) == dir;
+ if (i >= line1 && i <= line2)
+ v = 0;
+ else
+ v = match(i, 0) == dir;
setglobal(i, v);
}