cdimascio / dotenv-java

🗝️ Dotenv is a no-dep, pure Java module that loads environment variables from a .env file
https://github.com/cdimascio/dotenv-java
Apache License 2.0
444 stars 43 forks source link

Precompile and reuse regular expressions #33

Closed c00ler closed 1 year ago

c00ler commented 2 years ago

This pull request proposes a small performance improvement. Compilation of a regular expression pattern is a relatively "heavy" process. Since we use the same pattern in the loop it's possible to just compile it once and then re-use it. The other notable change is the upgrade of the JUnit to the latest version from 4.x branch. Since the functionality was not changed, the pull request doesn't have any changes to the tests.

c00ler commented 2 years ago

@cdimascio could you please have a look? Thank you!

cdimascio commented 1 year ago

@all-contributors add @c00ler for code

allcontributors[bot] commented 1 year ago

@cdimascio

I've put up a pull request to add @c00ler! :tada: