# 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;