]> git.sesse.net Git - remoteglot/commitdiff
Small cleanup.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 29 Dec 2020 10:38:36 +0000 (11:38 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 29 Dec 2020 10:38:36 +0000 (11:38 +0100)
remoteglot.pl

index 455d73066d56a24c41f2636ccb799f7a23b16262..c574ed05a62027a76b66d2dbf70b80d03cb054e9 100755 (executable)
@@ -650,10 +650,10 @@ sub output {
 
        # Don't update too often.
        my $wait = $remoteglotconf::update_max_interval - Time::HiRes::tv_interval($latest_update);
-       my $new_pos_wait = defined($pos_calculating_started) ?
-               $remoteglotconf::update_force_after_move - Time::HiRes::tv_interval($pos_calculating_started)
-               : 10000.0;
-       $wait = $new_pos_wait if ($new_pos_wait < $wait);
+       if (defined($pos_calculating_started)) {
+               my $new_pos_wait = $remoteglotconf::update_force_after_move - Time::HiRes::tv_interval($pos_calculating_started);
+               $wait = $new_pos_wait if ($new_pos_wait < $wait);
+       }
        if ($wait > 0.0) {
                $output_timer = AnyEvent->timer(after => $wait + 0.01, cb => \&output);
                return;