You are here

public function PHPExcel_HashTable::remove in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/HashTable.php \PHPExcel_HashTable::remove()

* Remove HashTable item * *

Parameters

PHPExcel_IComparable $pSource Item to remove: * @throws PHPExcel_Exception

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/HashTable.php, line 105

Class

PHPExcel_HashTable
PHPExcel_HashTable

Code

public function remove(PHPExcel_IComparable $pSource = null) {
  $hash = $pSource
    ->getHashCode();
  if (isset($this->_items[$hash])) {
    unset($this->_items[$hash]);
    $deleteKey = -1;
    foreach ($this->_keyMap as $key => $value) {
      if ($deleteKey >= 0) {
        $this->_keyMap[$key - 1] = $value;
      }
      if ($value == $hash) {
        $deleteKey = $key;
      }
    }
    unset($this->_keyMap[count($this->_keyMap) - 1]);
  }
}