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 panic when turning off use_cache #22

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

RobWalt
Copy link

@RobWalt RobWalt commented Jun 29, 2024

The main problem with the old code was that all of the cache RefCells
were held for too long because of the huge scope of the fuzzy
function. The problem was already solved by just wrapping some of the
code with an extra scope { + }. However I chose to refactor a bit
and split the old function into 3 new ones:

  • simple_match - was already there
  • sophisticated_match - basically the else case of simple_match
  • fuzzy_inner - a function just for the control flow of the other
    function. This also handles the cache invalidation

This should supersede the pull request #20

@LoricAndre
Copy link

Hi, could you please push an empty commit to trigger the CI ?

The main problem with the old code was that all of the cache RefCells
were held for too long because of the huge scope of the `fuzzy`
function. The problem was already solved by just wrapping some of the
code with an extra scope `{` + `}`. However I chose to refactor a bit
and split the old function into 3 new ones:

- `simple_match` - was already there
- `sophisticated_match` - basically the else case of `simple_match`
- `fuzzy_inner` - a function just for the control flow of the other
  function. This also handles the cache invalidation

This should supersede the pull request skim-rs#20
@RobWalt
Copy link
Author

RobWalt commented Nov 19, 2024

@LoricAndre Doesn't really seem to work

@LoricAndre
Copy link

@RobWalt could you please fix the tests before we can review this ?

@RobWalt
Copy link
Author

RobWalt commented Nov 21, 2024

@LoricAndre Sure, should I open a separate PR for this as this has nothing to do with my changes? (The CI also fails on main for the same reason)

I think it's mainly because of the old version of thread_local that is being used.

@LoricAndre
Copy link

Then wait for a bit, we have some work on skim itself then we'll work on updating this repo and making sure everything looks alright, then you can rebase and we'll merge this
Sorry

@RobWalt
Copy link
Author

RobWalt commented Nov 21, 2024

No worries! Thanks for taking the time to review the pull request!

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