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

code-Update main.ts #6856

Closed
wants to merge 1 commit into from
Closed

Conversation

romashka-btc
Copy link

Fix: Replaced String.match() with RegExp.exec() for efficiency

Changes

  • tooling/noir_codegen/src/main.ts:40: Updated the use of String.match() to RegExp.exec() for better performance.

    • Before:

      const match = filesOrPattern[0].match(/(['\S\s]*)/)?.[1];
    • After:

      const regex = /(['\S\s]*)/;
      const result = regex.exec(filesOrPattern[0]);
      const match = result ? result[1] : null;

Purpose

  • Improved performance and adherence to best practices by using RegExp.exec() instead of String.match().

Copy link
Contributor

Thank you for your contribution to the Noir language.

Please do not force push to this branch after the Noir team have started review of this PR. Doing so will only delay us merging your PR as we will need to start the review process from scratch.

Thanks for your understanding.

@TomAFrench
Copy link
Member

Closing as these are interchangeable for our purposes.

@TomAFrench TomAFrench closed this Dec 18, 2024
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