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

Move enzymeMap to package level, compile regular expressions only once #273

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

matiasinsaurralde
Copy link
Contributor

I think that this might be useful and perform better if you're calling getBaseRestrictionEnzymes multiple times in the same function. Before this change, getBaseRestrictionEnzymes would compile the same regular expressions over and over.

@gitpod-io
Copy link

gitpod-io bot commented Oct 15, 2022

@TimothyStiles
Copy link
Collaborator

Thanks for the PR @matiasinsaurralde! It looks like @Koeng101 defined enzymeMap as a function so that it'd behave as a constant but maybe it's no longer necessary that it does.

https://qvault.io/2019/10/21/golang-constant-maps-slices/

Do you remember the reasoning behind this @Koeng101?

Copy link
Contributor

@Koeng101 Koeng101 left a comment

Choose a reason for hiding this comment

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

LGTM

@Koeng101
Copy link
Contributor

The reason was I just wanted an easy way to see default enzymes. However, the reasoning to put it behind a function makes sense to me.

@TimothyStiles TimothyStiles merged commit ab57dd0 into bebop:main Oct 17, 2022
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.

None yet

3 participants