Minor performance tweak to PHPTemp and DiscISAM caching

This commit is contained in:
MarkBaker 2014-08-16 11:12:32 +01:00
parent bdb8b50156
commit 125f39c745
2 changed files with 10 additions and 10 deletions

View File

@ -69,10 +69,10 @@ class PHPExcel_CachedObjectStorage_DiscISAM extends PHPExcel_CachedObjectStorage
$this->_currentObject->detach();
fseek($this->_fileHandle,0,SEEK_END);
$offset = ftell($this->_fileHandle);
fwrite($this->_fileHandle, serialize($this->_currentObject));
$this->_cellCache[$this->_currentObjectID] = array('ptr' => $offset,
'sz' => ftell($this->_fileHandle) - $offset
$this->_cellCache[$this->_currentObjectID] = array(
'ptr' => ftell($this->_fileHandle),
'sz' => fwrite($this->_fileHandle, serialize($this->_currentObject))
);
$this->_currentCellIsDirty = false;
}

View File

@ -61,10 +61,10 @@ class PHPExcel_CachedObjectStorage_PHPTemp extends PHPExcel_CachedObjectStorage_
$this->_currentObject->detach();
fseek($this->_fileHandle,0,SEEK_END);
$offset = ftell($this->_fileHandle);
fwrite($this->_fileHandle, serialize($this->_currentObject));
$this->_cellCache[$this->_currentObjectID] = array('ptr' => $offset,
'sz' => ftell($this->_fileHandle) - $offset
$this->_cellCache[$this->_currentObjectID] = array(
'ptr' => ftell($this->_fileHandle),
'sz' => fwrite($this->_fileHandle, serialize($this->_currentObject))
);
$this->_currentCellIsDirty = false;
}