original_string: public function isSame(Index $other, $renamedColumns = null)
      {
          if ($renamedColumns) {
              $columns = [];
              foreach ($this->columns as $col) {
                  $columns[] = isset($renamedColumns[$col]) ? $renamedColumns[$col]->name : $col;
              }
          } else {
              $columns = $this->columns;
          }
          if ($columns != $other->columns) {
              return false;
          }
          if ($this->name == self::PRIMARY || $other->name == self::PRIMARY) {
              return $this->name == $other->name;
          } else {
              return $this->type == $other->type;
          }
      }
code: public function isSame(Index $other, $renamedColumns = null)
      {
          if ($renamedColumns) {
              $columns = [];
              foreach ($this->columns as $col) {
                  $columns[] = isset($renamedColumns[$col]) ? $renamedColumns[$col]->name : $col;
              }
          } else {
              $columns = $this->columns;
          }
          if ($columns != $other->columns) {
              return false;
          }
          if ($this->name == self::PRIMARY || $other->name == self::PRIMARY) {
              return $this->name == $other->name;
          } else {
              return $this->type == $other->type;
          }
      }
code_tokens: public function isSame ( Index $ other , $ renamedColumns = null ) { if ( $ renamedColumns ) { $ columns = [ ] ; foreach ( $ this -> columns as $ col ) { $ columns [ ] = isset ( $ renamedColumns [ $ col ] ) ? $ renamedColumns [ $ col ] -> name : $ col ; } } else { $ columns = $ this -> columns ; } if ( $ columns != $ other -> columns ) { return false ; } if ( $ this -> name == self :: PRIMARY || $ other -> name == self :: PRIMARY ) { return $ this -> name == $ other -> name ; } else { return $ this -> type == $ other -> type ; } }
docstring: compare with index
  
  @param Index $other
  @param array $renamedColumns
  @return boolean
docstring_tokens: compare with index