Browse files

optimized string starts with checks

Doing this with strpos() is slightly faster than substr().
  • Loading branch information...
1 parent c02441f commit cb427d48e4e7ac3abcdb2785de08a59c5191fe37 @kriswallsmith kriswallsmith committed Jan 11, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 Client.php
View
2 Client.php
@@ -441,7 +441,7 @@ public function restart()
protected function getAbsoluteUri($uri)
{
// already absolute?
- if ('http' === substr($uri, 0, 4)) {
+ if (0 === strpos($uri, 'http')) {
return $uri;
}

0 comments on commit cb427d4

Please sign in to comment.