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

Less clones & consistent search result indexes #441

Merged
merged 17 commits into from
Mar 6, 2025

Conversation

hasezoey
Copy link
Contributor

@hasezoey hasezoey commented Mar 5, 2025

This PR mainly focuses on doing less clones, but also does some other slight fixes that would be annoying to put in their separate PRs:

  • dont clone where not necessary
  • change some functions to not need to clone themself (ie dont take a reference which is always cloned)
  • change all search results to start numbering at 1
  • change all search indexes to be usize to prevent early wrapping (rust defaults to i32 for some reason)
  • dont do some things unless in the error case (replace context with with_context)
  • for first db results, dont allocate a full vector, take the first element from the iterator directly
  • change PCMsg::Error to not have a duplicate url(String) as feed already contains it

hasezoey and others added 17 commits March 5, 2025 13:16
…hter change checking

because either a append, delete or noop will happen, never a replace. So the length will either be longer, shorter or nothing changed.
also force idx to be usize, otherwise early wrap might occur
@tramhao tramhao merged commit b55b2a3 into tramhao:master Mar 6, 2025
5 checks passed
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