From ee53e992a4969fe20dcf6dc7b826da2380bdc0a8 Mon Sep 17 00:00:00 2001 From: ruan Date: Tue, 4 Oct 2016 01:47:31 +0200 Subject: [PATCH] Simplify get_name even further --- inc/page.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/inc/page.php b/inc/page.php index 42d0259..aaa7806 100644 --- a/inc/page.php +++ b/inc/page.php @@ -221,14 +221,12 @@ class Page { } if (array_key_exists($uuid, $this->uuid_name_cache)) return $this->uuid_name_cache[$uuid]; - $history = $this->settings->table['history']; - $stmt = $this->conn->prepare("SELECT name FROM $history WHERE uuid=? ORDER BY date DESC LIMIT 1"); $result = null; + $history = $this->settings->table['history']; + $stmt = $this->conn->prepare("SELECT name FROM $history WHERE uuid=? ORDER BY date DESC LIMIT 1"); if ($stmt->execute(array($uuid)) && $row = $stmt->fetch()) { - $name = $row['name']; - $this->uuid_name_cache[$uuid] = $name; - $result = $name; + $result = $row['name']; } $stmt->closeCursor();