Skip to content

Commit

Permalink
Simplify checking for empty
Browse files Browse the repository at this point in the history
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
  • Loading branch information
madhuracj committed Jan 2, 2015
1 parent 31a1b73 commit 62631f7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/RecentFavoriteTable.class.php
Expand Up @@ -60,7 +60,7 @@ private function __construct($type)
if (! isset($_SESSION['tmpval'][$this->_tableType . '_tables'][$server_id])
) {
$_SESSION['tmpval'][$this->_tableType . '_tables'][$server_id]
= (! empty($this->_getPmaTable())) ? $this->getFromDb() : array();
= $this->_getPmaTable() ? $this->getFromDb() : array();
}
$this->_tables
=& $_SESSION['tmpval'][$this->_tableType . '_tables'][$server_id];
Expand Down Expand Up @@ -284,7 +284,7 @@ public function add($db, $table)
array_unshift($this->_tables, $table_arr);
$this->_tables = array_merge(array_unique($this->_tables, SORT_REGULAR));
$this->trim();
if (! empty($this->_getPmaTable())) {
if ($this->_getPmaTable()) {
return $this->saveToDb();
}
}
Expand Down Expand Up @@ -331,7 +331,7 @@ public function remove($db, $table)
unset($this->_tables[$key]);
}
}
if (! empty($this->_getPmaTable())) {
if ($this->_getPmaTable()) {
return $this->saveToDb();
}
return true;
Expand Down

0 comments on commit 62631f7

Please sign in to comment.