Browse code

Group together num_lines logic

John Hawthorn authored on 17/05/2016 03:08:57
Showing 1 changed files

  • fzy.c index a84b125..de6535c 100644
... ...
@@ -256,9 +256,6 @@ int main(int argc, char *argv[]) {
256 256
 	choices_init(&choices);
257 257
 	choices_fread(&choices, stdin);
258 258
 
259
-	if (num_lines > choices.size)
260
-		num_lines = choices.size;
261
-
262 259
 	if (benchmark) {
263 260
 		if (!filter) {
264 261
 			fprintf(stderr, "Must specify -e/--show-matches with --benchmark\n");
... ...
@@ -278,6 +275,9 @@ int main(int argc, char *argv[]) {
278 275
 		tty_t tty;
279 276
 		tty_init(&tty, tty_filename);
280 277
 
278
+		if (num_lines > choices.size)
279
+			num_lines = choices.size;
280
+
281 281
 		if (num_lines + 1 > tty_getheight(&tty))
282 282
 			num_lines = tty_getheight(&tty) - 1;
283 283