Skip to content
Snippets Groups Projects
Commit ea553676 authored by Michael Gapczynski's avatar Michael Gapczynski
Browse files

Organize conditionals in a better order

parent 04805d0b
No related branches found
No related tags found
No related merge requests found
......@@ -78,19 +78,15 @@ class Scanner {
$this->scanFile($parent);
}
}
$newData = $data;
if ($cacheData = $this->cache->get($file)) {
if ($checkExisting && $data['size'] === -1) {
$data['size'] = $cacheData['size'];
}
if ($data['mtime'] === $cacheData['mtime'] &&
$data['size'] === $cacheData['size']) {
$data['etag'] = $cacheData['etag'];
}
}
if ($checkExisting and $cacheData) {
if ($data['size'] === -1) {
$data['size'] = $cacheData['size'];
}
}
$newData = $data;
if ($cacheData) {
// Only update metadata that has changed
$newData = array_diff($data, $cacheData);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment