From 381b47a0a91300deb0b646378db2b1a004fc3606 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Fri, 24 Jul 2009 12:39:48 +0200 Subject: [PATCH] Don't do useless checks --- src/conky.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/conky.c b/src/conky.c index e2cc74b2..3f732b3b 100644 --- a/src/conky.c +++ b/src/conky.c @@ -7085,12 +7085,15 @@ static void main_loop(void) next_update_time = get_time(); info.looped = 0; while (terminate == 0 && (total_run_times == 0 || info.looped < total_run_times)) { - char buf[max_user_text]; - get_battery_short_status(buf, max_user_text, "BAT0"); - if(buf[0] == 'D') { - update_interval = update_interval_bat; - } else { - update_interval = update_interval_old; + if(update_interval_bat != update_interval_old) { + char buf[max_user_text]; + + get_battery_short_status(buf, max_user_text, "BAT0"); + if(buf[0] == 'D') { + update_interval = update_interval_bat; + } else { + update_interval = update_interval_old; + } } info.looped++;