From ea3e7ed458a43a2e9f7ff983273cba290b39b1c8 Mon Sep 17 00:00:00 2001 From: speedie Date: Tue, 16 May 2023 21:04:32 +0200 Subject: [PATCH] remove unnecessary match() calls in setlines() and setcolumns() --- libs/arg.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/libs/arg.c b/libs/arg.c index 2bbb6e2..621b10d 100644 --- a/libs/arg.c +++ b/libs/arg.c @@ -467,20 +467,34 @@ void defaultimg(Arg *arg) { void setlines(Arg *arg) { if (fullscreen) return; - lines += arg->i; - if (lines < 0) lines = 0; - match(); + lines += arg->i; + + if (lines < 0) { + lines = 0; + } + + if (lines == 0) { + match(); + } + resizeclient(); drawmenu(); } void setcolumns(Arg *arg) { if (fullscreen) return; - columns += arg->i; - if (columns < 1) columns = 1; - match(); + columns += arg->i; + + if (columns < 1) { + columns = 1; + } + + if (lines == 0) { + match(); + } + resizeclient(); drawmenu(); }