mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 10:48:51 +00:00
THRIFT-1521:patches for more Performance
Client: php Patch: D. Edler Removes double function calls in the transport classes to strlen. git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1390051 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
41dfe6fd5e
commit
78a54a17f1
@ -59,13 +59,15 @@ class TMemoryBuffer extends TTransport {
|
||||
}
|
||||
|
||||
public function read($len) {
|
||||
if (TStringFuncFactory::create()->strlen($this->buf_) === 0) {
|
||||
$bufLength = TStringFuncFactory::create()->strlen($this->buf_);
|
||||
|
||||
if ($bufLength === 0) {
|
||||
throw new TTransportException('TMemoryBuffer: Could not read ' .
|
||||
$len . ' bytes from buffer.',
|
||||
TTransportException::UNKNOWN);
|
||||
}
|
||||
|
||||
if (TStringFuncFactory::create()->strlen($this->buf_) <= $len) {
|
||||
if ($bufLength <= $len) {
|
||||
$ret = $this->buf_;
|
||||
$this->buf_ = '';
|
||||
return $ret;
|
||||
|
Loading…
Reference in New Issue
Block a user