cvs: pear /Net_GameServerQuery/GameServerQuery/Protocol GameSpy04.php

From: Date: Tue, 18 Jan 2005 15:56:06 +0000
Subject: cvs: pear /Net_GameServerQuery/GameServerQuery/Protocol GameSpy04.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-28662@lists.php.net to get a copy of this message
aidan Tue Jan 18 10:56:06 2005 EDT Modified files: /pear/Net_GameServerQuery/GameServerQuery/Protocol GameSpy04.php Log: Used skip() method (which is faster) and readAhead (no lookaheads in read() for speed reasons) http://cvs.php.net/diff.php/pear/Net_GameServerQuery/GameServerQuery/Protocol/GameSpy04.php?r1=1.17&r2=1.18&ty=u Index: pear/Net_GameServerQuery/GameServerQuery/Protocol/GameSpy04.php diff -u pear/Net_GameServerQuery/GameServerQuery/Protocol/GameSpy04.php:1.17 pear/Net_GameServerQuery/GameServerQuery/Protocol/GameSpy04.php:1.18 --- pear/Net_GameServerQuery/GameServerQuery/Protocol/GameSpy04.php:1.17 Mon Jan 17 23:59:37 2005 +++ pear/Net_GameServerQuery/GameServerQuery/Protocol/GameSpy04.php Tue Jan 18 10:56:06 2005 @@ -16,7 +16,7 @@ // | Tom Buskens <ortega@php.net> | // +----------------------------------------------------------------------+ // -// $Id: GameSpy04.php,v 1.17 2005/01/18 04:59:37 aidan Exp $ +// $Id: GameSpy04.php,v 1.18 2005/01/18 15:56:06 aidan Exp $ require_once NET_GAMESERVERQUERY_BASE . 'Protocol.php'; @@ -29,7 +29,7 @@ * @package Net_GameServerQuery * @author Aidan Lister <aidan@php.net> * @author Tom Buskens <ortega@php.net> - * @version $Revision: 1.17 $ + * @version $Revision: 1.18 $ */ class Net_GameServerQuery_Protocol_GameSpy04 extends Net_GameServerQuery_Protocol { @@ -45,7 +45,7 @@ $buffer->read(4); - if ($buffer->readLast() !== "\x0") { + if ($buffer->readLast() !== "\x00") { return false; } @@ -84,8 +84,8 @@ } // Look ahead - if ($buffer->read(1, true) === "\x00") { - $buffer->read(); + if ($buffer->readAhead() === "\x00") { + $buffer->skip(); break; } } @@ -97,8 +97,8 @@ } // Look ahead - if ($buffer->read(1, true) === "\x00") { - $buffer->read(); + if ($buffer->readAhead() === "\x00") { + $buffer->skip(); break; } } @@ -112,8 +112,8 @@ $varnames[] = $buffer->readString(); // Look ahead - if ($buffer->read(1, true) === "\x00") { - $buffer->read(); + if ($buffer->readAhead() === "\x00") { + $buffer->skip(); break; } } @@ -127,8 +127,8 @@ ++$i; // Look ahead - if ($buffer->read(1, true) === "\x00") { - $buffer->read(); + if ($buffer->readAhead() === "\x00") { + $buffer->skip(); break; } }

« previous php.pear.cvs (#28662) next »