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

perf: improve ifUserHasNotifications() #330

Merged
merged 1 commit into from
Jul 2, 2023

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Jul 2, 2023

Please review, @brunocorrea23.

@brunocorrea23
Copy link
Contributor

LGTM.
Curiosity: why the change?

@iuioiua
Copy link
Contributor Author

iuioiua commented Jul 2, 2023

Previously, the check would iterate through the entire list of notifications. Now, it returns true on the first iteration.

It's important that this function incurs the smallest performance hit possible, as it's called upon every request.

@iuioiua iuioiua merged commit 61cbe30 into main Jul 2, 2023
@iuioiua iuioiua deleted the ifUserHasNotifications-speedup branch July 2, 2023 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants