diff options
author | Bart Van Assche <bvanassche@google.com> | 2022-10-17 10:28:46 -0700 |
---|---|---|
committer | Bart Van Assche <bvanassche@google.com> | 2022-10-20 09:32:51 -0700 |
commit | 4842650043b67bcdf3ff7fd6e1dc9691b46aa41b (patch) | |
tree | 0e4ae2156b9288817faf1ad88588538757b9111c | |
parent | cc7ddc04f939a199e4aeedf543cb0af4c4a16b9c (diff) | |
download | core-4842650043b67bcdf3ff7fd6e1dc9691b46aa41b.tar.gz |
init: Improve readability of the code in SecondStageMain()
Change the type of epoll_timeout from
std::optional<std::chrono:milliseconds> into std::chrono::milliseconds.
No functionality is changed.
Bug: 213617178
Change-Id: Ieb150e0aeabdb79c8da4649875ea3ed59297343b
Signed-off-by: Bart Van Assche <bvanassche@google.com>
-rw-r--r-- | init/init.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/init/init.cpp b/init/init.cpp index cd0ee58ec..f9e7c6ea1 100644 --- a/init/init.cpp +++ b/init/init.cpp @@ -1148,7 +1148,7 @@ int SecondStageMain(int argc, char** argv) { setpriority(PRIO_PROCESS, 0, 0); while (true) { // By default, sleep until something happens. - auto epoll_timeout = std::optional<std::chrono::milliseconds>{kDiagnosticTimeout}; + std::chrono::milliseconds epoll_timeout{kDiagnosticTimeout}; auto shutdown_command = shutdown_state.CheckShutdown(); if (shutdown_command) { @@ -1168,7 +1168,7 @@ int SecondStageMain(int argc, char** argv) { if (next_process_action_time) { epoll_timeout = std::chrono::ceil<std::chrono::milliseconds>( *next_process_action_time - boot_clock::now()); - if (*epoll_timeout < 0ms) epoll_timeout = 0ms; + if (epoll_timeout < 0ms) epoll_timeout = 0ms; } } |