Use std::get_if

This commit is contained in:
blankie 2023-03-28 19:55:44 +07:00
parent 283b5e9f4d
commit 39a7faa465
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 4 additions and 4 deletions

View File

@ -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<LogEntry>(*logcat_thread_item)) {
log(std::move(std::get<LogEntry>(*logcat_thread_item)), false);
} else if (std::holds_alternative<LogcatEntry>(*logcat_thread_item)) {
logcat_entries.push_back(std::move(std::get<LogcatEntry>(*logcat_thread_item)));
if (LogEntry* log_entry = std::get_if<LogEntry>(logcat_thread_item)) {
log(std::move(*log_entry), false);
} else if (LogcatEntry* logcat_entry = std::get_if<LogcatEntry>(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);
}