Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: don't create a dummy LogDb when opening the Rerun Menu #1440

Merged
merged 2 commits into from Feb 28, 2023

Conversation

emilk
Copy link
Member

@emilk emilk commented Feb 28, 2023

Closes #914

Checklist

@emilk emilk added 🪳 bug Something isn't working ui concerns graphical user interface 📺 re_viewer affects re_viewer itself labels Feb 28, 2023
@teh-cmc teh-cmc self-requested a review February 28, 2023 15:36
Comment on lines +749 to +753
fn log_db_is_nonempty(&self) -> bool {
self.log_dbs
.get(&self.state.selected_rec_id)
.map_or(false, |log_db| !log_db.is_empty())
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is_nonempty feels very non-idiomatic and double-negativist... false means it's not non-empty?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but I failed to find something better. Negating it we get something like log_db_is_empty_or_there_is_no_log_db

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an explanatory docstring that might help.

@emilk emilk merged commit 6be85c0 into main Feb 28, 2023
@emilk emilk deleted the emilk/fix-app-log_db-complexity branch February 28, 2023 16:40
emilk added a commit that referenced this pull request Mar 2, 2023
* Fix: don't create a dummy LogDb when opening the Rerun Menu

* Add explanatory docstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🪳 bug Something isn't working 📺 re_viewer affects re_viewer itself ui concerns graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

viewer: recording list shows a non-empty list even when there are no recordings
2 participants