braintree / credit-card-type

A library for determining credit card type
MIT License
985 stars 154 forks source link

calculate RegExp once instead of on every check #13

Closed chrisblossom closed 8 years ago

chrisblossom commented 8 years ago

This is an optimization for creating the regex checks for each type of card. Previously the check was created every time the number was checked. Now it is created once when the module is loaded.

crookedneighbor commented 8 years ago

Hey @chrisblossom, thanks for submitting this. It's definitely a more performant solution, but as it turns out, we're working on some other optimization strategies that will conflict with this change, so I'm going to close this now.

Thanks again for your interest in this project!