Skip to content

Change function_exists to &self#796

Merged
zshipko merged 1 commit intoextism:mainfrom
milesj:patch-1
Dec 2, 2024
Merged

Change function_exists to &self#796
zshipko merged 1 commit intoextism:mainfrom
milesj:patch-1

Conversation

@milesj
Copy link
Copy Markdown
Contributor

@milesj milesj commented Dec 1, 2024

I wrap the Plugin instance in a RwLock and because function_exists requires &mut self, I have to acquire a write lock everytime to just check if a function exists, which causes lock contention.

This changes it to &self since it doesn't need to mutate.

@milesj milesj requested a review from zshipko as a code owner December 1, 2024 00:37
@bhelx
Copy link
Copy Markdown
Contributor

bhelx commented Dec 1, 2024

Thank you :)

Will have @zshipko peek at it on Monday

Copy link
Copy Markdown
Contributor

@zshipko zshipko left a comment

Choose a reason for hiding this comment

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

Thanks! Test failures are clippy related, I will fix those in a follow up PR.

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.

3 participants