diff options
author | Frediano Ziglio <freddy77@gmail.com> | 2021-05-31 07:56:00 +0100 |
---|---|---|
committer | Frediano Ziglio <freddy77@gmail.com> | 2023-11-22 07:39:19 +0000 |
commit | 0cd85544e14c3427c8c01f5075f760cc31d02cc6 (patch) | |
tree | fd90edc0a29057e6a486066c5d848f6c80715b53 | |
parent | 73cee2f9504727ac0dc7027319bedddf2157d7c4 (diff) |
XXX C++ style
-rw-r--r-- | server/display-channel.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/server/display-channel.cpp b/server/display-channel.cpp index 91e5fe1d..2e929e93 100644 --- a/server/display-channel.cpp +++ b/server/display-channel.cpp @@ -141,18 +141,13 @@ int display_channel_get_streams_timeout(DisplayChannel *display) int timeout = INT_MAX; red_time_t now = spice_get_monotonic_time_ns(); - auto it = display->priv->streams.begin(); - const auto end = display->priv->streams.end(); - while (it != end) { - VideoStream *stream = &(*it); - it++; - - red_time_t delta = (stream->last_time + RED_STREAM_TIMEOUT) - now; + for (const auto& stream : display->priv->streams) { + red_time_t delta = (stream.last_time + RED_STREAM_TIMEOUT) - now; if (delta < NSEC_PER_MILLISEC) { return 0; } - timeout = MIN(timeout, (unsigned int)(delta / NSEC_PER_MILLISEC)); + timeout = std::min(timeout, int{delta / NSEC_PER_MILLISEC}); } return timeout; } |