diff --git a/event_loop.cpp b/event_loop.cpp index 18d9518..c527df4 100644 --- a/event_loop.cpp +++ b/event_loop.cpp @@ -17,10 +17,10 @@ static inline void check_for_logcat_items(LogcatThread& logcat_thread, const Con LogcatThreadItem* logcat_thread_item; while ((logcat_thread_item = logcat_thread.atomic_ring_buffer.get())) { - if (std::holds_alternative(*logcat_thread_item)) { - log(std::move(std::get(*logcat_thread_item)), false); - } else if (std::holds_alternative(*logcat_thread_item)) { - logcat_entries.push_back(std::move(std::get(*logcat_thread_item))); + if (LogEntry* log_entry = std::get_if(logcat_thread_item)) { + log(std::move(*log_entry), false); + } else if (LogcatEntry* logcat_entry = std::get_if(logcat_thread_item)) { + logcat_entries.push_back(std::move(*logcat_entry)); if (matches(logcat_entries.back(), active_config.filters, active_config.exclusions)) { filtered_logcat_entry_offsets.push_back(logcat_entries.size() - 1); }