Permalink
Browse files

[Http] Perf tweak to parsing the start line of a HTTP response

  • Loading branch information...
1 parent d1e001e commit a0690f5f8a8ecfb7792ad6dc916dc5a109d58247 @mtdowling mtdowling committed Aug 25, 2012
Showing with 3 additions and 7 deletions.
  1. +3 −7 src/Guzzle/Http/Message/Request.php
View
10 src/Guzzle/Http/Message/Request.php
@@ -492,13 +492,9 @@ public function receiveResponseHeader($data)
if (strpos($data, 'HTTP/') === 0) {
- $statusLine = explode(' ', $data, 3);
- if (isset($statusLine[2])) {
- list( , $code, $status) = $statusLine;
- } else {
- $code = $statusLine[1];
- $status = '';
- }
+ $startLine = explode(' ', $data, 3);
+ $code = $startLine[1];
+ $status = isset($startLine[2]) ? $startLine[2] : '';
// Only download the body of the response to the specified response
// body when a successful response is received.

0 comments on commit a0690f5

Please sign in to comment.