Ejemplo n.º 1
0
 public function consolidate(array $table, $limit = 0)
 {
     $incumbent_key;
     $cluster = array();
     $position = 0;
     for ($max = count($table); $max > -1;) {
         --$max;
         if (!isset($incumbent_key) || $incumbent_key === $table[$max][key($table[$max])]) {
             $cluster[] = $table[$max];
             $incumbent_key = $table[$max][key($table[$max])];
         } else {
             $incumbent_key = $table[$max][key($table[$max])];
             if (count($cluster) === 1) {
                 $this->rows[$position++] = $cluster;
             } else {
                 if (count($cluster) > 1) {
                     $this->processCluster($cluster, $position++);
                     $cluster = [$table[$max]];
                 }
             }
         }
     }
     return \Segment\utilities\Utilities::arrayCopy($this->rows);
 }
Ejemplo n.º 2
0
 public function __clone()
 {
     $this->queue = \Segment\utilities\Utilities::arrayCopy($this->queue);
 }