summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-03-04 23:19:55 +0100
committerRobin Appelman <icewind@owncloud.com>2013-03-04 23:19:55 +0100
commit9d9acf24de482bdd5d0b700ba75631b246e5699b (patch)
tree7ef3a4806952a6729feab3fcf2cfdf3ac24c6d23 /lib
parent56ae4bb6e9a08c5ada36b4c42ae4e22eaf288df7 (diff)
downloadnextcloud-server-9d9acf24de482bdd5d0b700ba75631b246e5699b.tar.gz
nextcloud-server-9d9acf24de482bdd5d0b700ba75631b246e5699b.zip
Cache: more efficient detection for existing entries during upgrade
Diffstat (limited to 'lib')
-rw-r--r--lib/files/cache/upgrade.php12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/files/cache/upgrade.php b/lib/files/cache/upgrade.php
index 4d98abb2f8d..811d82d7437 100644
--- a/lib/files/cache/upgrade.php
+++ b/lib/files/cache/upgrade.php
@@ -82,15 +82,9 @@ class Upgrade {
* @return bool
*/
function inCache($storage, $pathHash, $id) {
- $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE `storage` = ? AND `path_hash` = ?');
- $result = $query->execute(array($storage, $pathHash));
- if ($result->fetchRow()) {
- return true;
- } else {
- $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE `fileid` = ?');
- $result = $query->execute(array($id));
- return (bool)$result->fetchRow();
- }
+ $query = \OC_DB::prepare('SELECT `fileid` FROM `*PREFIX*filecache` WHERE (`storage` = ? AND `path_hash` = ?) OR `fileid` = ?');
+ $result = $query->execute(array($storage, $pathHash, $id));
+ return (bool)$result->fetchRow();
}
/**