Use std::get_if
This commit is contained in:
parent
283b5e9f4d
commit
39a7faa465
|
@ -17,10 +17,10 @@ static inline void check_for_logcat_items(LogcatThread& logcat_thread, const Con
|
||||||
LogcatThreadItem* logcat_thread_item;
|
LogcatThreadItem* logcat_thread_item;
|
||||||
|
|
||||||
while ((logcat_thread_item = logcat_thread.atomic_ring_buffer.get())) {
|
while ((logcat_thread_item = logcat_thread.atomic_ring_buffer.get())) {
|
||||||
if (std::holds_alternative<LogEntry>(*logcat_thread_item)) {
|
if (LogEntry* log_entry = std::get_if<LogEntry>(logcat_thread_item)) {
|
||||||
log(std::move(std::get<LogEntry>(*logcat_thread_item)), false);
|
log(std::move(*log_entry), false);
|
||||||
} else if (std::holds_alternative<LogcatEntry>(*logcat_thread_item)) {
|
} else if (LogcatEntry* logcat_entry = std::get_if<LogcatEntry>(logcat_thread_item)) {
|
||||||
logcat_entries.push_back(std::move(std::get<LogcatEntry>(*logcat_thread_item)));
|
logcat_entries.push_back(std::move(*logcat_entry));
|
||||||
if (matches(logcat_entries.back(), active_config.filters, active_config.exclusions)) {
|
if (matches(logcat_entries.back(), active_config.filters, active_config.exclusions)) {
|
||||||
filtered_logcat_entry_offsets.push_back(logcat_entries.size() - 1);
|
filtered_logcat_entry_offsets.push_back(logcat_entries.size() - 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue