MyIntervals / emogrifier

Converts CSS styles into inline style attributes in your HTML code.
https://www.myintervals.com/emogrifier.php
MIT License
905 stars 153 forks source link

[CLEANUP] Remove unnecessary `md5()` call in `CssInliner::getCssSelectorPrecedence()` #1272

Closed TimWolla closed 2 months ago

TimWolla commented 2 months ago

The input selector is guaranteed to be a string, so we can directly index the cache array with it. This avoids the overhead of calculating the cryptographic hash and the creation of a fresh string, makes the array more friendly for manual inspection using a debugger and avoids using a function that might be deprecated with PHP 8.4.