Navigation Menu

Skip to content

Commit

Permalink
Improved Performance of processResponse
Browse files Browse the repository at this point in the history
As bin2hex is a bit slow, only parse the start of the string
  • Loading branch information
simoor committed Apr 12, 2018
1 parent 2b70bec commit 939203f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/WooCommerce/HttpClient/HttpClient.php
Expand Up @@ -363,7 +363,7 @@ protected function processResponse()
{
$body = $this->response->getBody();

if (0 === strpos(bin2hex($body), 'efbbbf')) {
if (0 === strpos(bin2hex(substr($body, 0, 4)), 'efbbbf')) {
$body = substr($body, 3);
}

Expand Down

0 comments on commit 939203f

Please sign in to comment.