Always use std::min, std::max.
This commit is contained in:
@@ -682,11 +682,11 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &
|
||||
int timeout = INT_MAX;
|
||||
uint64_t now = Network::timestamp();
|
||||
|
||||
timeout = min( timeout, network.wait_time() );
|
||||
timeout = min( timeout, terminal.wait_time( now ) );
|
||||
timeout = std::min( timeout, network.wait_time() );
|
||||
timeout = std::min( timeout, terminal.wait_time( now ) );
|
||||
if ( (!network.get_remote_state_num())
|
||||
|| network.shutdown_in_progress() ) {
|
||||
timeout = min( timeout, 5000 );
|
||||
timeout = std::min( timeout, 5000 );
|
||||
}
|
||||
/*
|
||||
* The server goes completely asleep if it has no remote peer.
|
||||
@@ -701,7 +701,7 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &
|
||||
/* 24 days might be too soon. That's OK. */
|
||||
network_sleep = INT_MAX;
|
||||
}
|
||||
timeout = min( timeout, static_cast<int>(network_sleep) );
|
||||
timeout = std::min( timeout, static_cast<int>(network_sleep) );
|
||||
}
|
||||
|
||||
/* poll for events */
|
||||
|
||||
Reference in New Issue
Block a user