original_string: private function _hasAnythingToMerge()
      {
          $segmentSizes = array();
          foreach ($this->_segmentInfos as $segName => $segmentInfo) {
              $segmentSizes[$segName] = $segmentInfo->count();
          }
  
          $mergePool   = array();
          $poolSize    = 0;
          $sizeToMerge = $this->maxBufferedDocs;
          asort($segmentSizes, SORT_NUMERIC);
          foreach ($segmentSizes as $segName => $size) {
              // Check, if segment comes into a new merging block
              while ($size >= $sizeToMerge) {
                  // Merge previous block if it's large enough
                  if ($poolSize >= $sizeToMerge) {
                      return true;
                  }
                  $mergePool   = array();
                  $poolSize    = 0;
  
                  $sizeToMerge *= $this->mergeFactor;
  
                  if ($sizeToMerge > $this->maxMergeDocs) {
                      return false;
                  }
              }
  
              $mergePool[] = $this->_segmentInfos[$segName];
              $poolSize += $size;
          }
  
          if ($poolSize >= $sizeToMerge) {
              return true;
          }
  
          return false;
      }
code: private function _hasAnythingToMerge()
      {
          $segmentSizes = array();
          foreach ($this->_segmentInfos as $segName => $segmentInfo) {
              $segmentSizes[$segName] = $segmentInfo->count();
          }
  
          $mergePool   = array();
          $poolSize    = 0;
          $sizeToMerge = $this->maxBufferedDocs;
          asort($segmentSizes, SORT_NUMERIC);
          foreach ($segmentSizes as $segName => $size) {
              // Check, if segment comes into a new merging block
              while ($size >= $sizeToMerge) {
                  // Merge previous block if it's large enough
                  if ($poolSize >= $sizeToMerge) {
                      return true;
                  }
                  $mergePool   = array();
                  $poolSize    = 0;
  
                  $sizeToMerge *= $this->mergeFactor;
  
                  if ($sizeToMerge > $this->maxMergeDocs) {
                      return false;
                  }
              }
  
              $mergePool[] = $this->_segmentInfos[$segName];
              $poolSize += $size;
          }
  
          if ($poolSize >= $sizeToMerge) {
              return true;
          }
  
          return false;
      }
code_tokens: private function _hasAnythingToMerge ( ) { $ segmentSizes = array ( ) ; foreach ( $ this -> _segmentInfos as $ segName => $ segmentInfo ) { $ segmentSizes [ $ segName ] = $ segmentInfo -> count ( ) ; } $ mergePool = array ( ) ; $ poolSize = 0 ; $ sizeToMerge = $ this -> maxBufferedDocs ; asort ( $ segmentSizes , SORT_NUMERIC ) ; foreach ( $ segmentSizes as $ segName => $ size ) { // Check, if segment comes into a new merging block while ( $ size >= $ sizeToMerge ) { // Merge previous block if it's large enough if ( $ poolSize >= $ sizeToMerge ) { return true ; } $ mergePool = array ( ) ; $ poolSize = 0 ; $ sizeToMerge *= $ this -> mergeFactor ; if ( $ sizeToMerge > $ this -> maxMergeDocs ) { return false ; } } $ mergePool [ ] = $ this -> _segmentInfos [ $ segName ] ; $ poolSize += $ size ; } if ( $ poolSize >= $ sizeToMerge ) { return true ; } return false ; }
docstring: Check if we have anything to merge
  
  @return boolean
docstring_tokens: Check if we have anything to merge