summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-25 23:06:53 +0100
committerMorris Jobke <hey@morrisjobke.de>2018-01-26 11:35:42 +0100
commitc1e4f9f30563d5eda1718d716d631d6092cd4e28 (patch)
tree3bb7b6ef891cd80895d4c2c92252a4ccbc0c0cee /apps/files_versions
parentfe7e726ab228e6ddde7cf1442de9d0db193334a1 (diff)
downloadnextcloud-server-c1e4f9f30563d5eda1718d716d631d6092cd4e28.tar.gz
nextcloud-server-c1e4f9f30563d5eda1718d716d631d6092cd4e28.zip
Use type casting instead of *val() method
It should be up to 6x faster Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/lib/Expiration.php8
-rw-r--r--apps/files_versions/lib/Storage.php2
2 files changed, 5 insertions, 5 deletions
diff --git a/apps/files_versions/lib/Expiration.php b/apps/files_versions/lib/Expiration.php
index 1dad8801230..83195d10a30 100644
--- a/apps/files_versions/lib/Expiration.php
+++ b/apps/files_versions/lib/Expiration.php
@@ -175,13 +175,13 @@ class Expiration {
$this->canPurgeToSaveSpace = true;
} elseif ($minValue !== 'auto' && $maxValue === 'auto') {
// Keep for X days but delete anytime if space needed
- $this->minAge = intval($minValue);
+ $this->minAge = (int)$minValue;
$this->maxAge = self::NO_OBLIGATION;
$this->canPurgeToSaveSpace = true;
} elseif ($minValue === 'auto' && $maxValue !== 'auto') {
// Delete anytime if space needed, Delete all older than max automatically
$this->minAge = self::NO_OBLIGATION;
- $this->maxAge = intval($maxValue);
+ $this->maxAge = (int)$maxValue;
$this->canPurgeToSaveSpace = true;
} elseif ($minValue !== 'auto' && $maxValue !== 'auto') {
// Delete all older than max OR older than min if space needed
@@ -191,8 +191,8 @@ class Expiration {
$maxValue = $minValue;
}
- $this->minAge = intval($minValue);
- $this->maxAge = intval($maxValue);
+ $this->minAge = (int)$minValue;
+ $this->maxAge = (int)$maxValue;
$this->canPurgeToSaveSpace = false;
}
}
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php
index d798312fda3..f8a6636839a 100644
--- a/apps/files_versions/lib/Storage.php
+++ b/apps/files_versions/lib/Storage.php
@@ -503,7 +503,7 @@ class Storage {
$toDelete = [];
foreach (array_reverse($versions['all']) as $key => $version) {
- if (intval($version['version'])<$threshold) {
+ if ((int)$version['version'] <$threshold) {
$toDelete[$key] = $version;
} else {
//Versions are sorted by time - nothing mo to iterate.