Fix bad cache detection

This commit is contained in:
Knah Tsaeb 2024-08-23 16:53:13 +02:00
parent 698d85080b
commit 01cbfb3c5e

View file

@ -97,11 +97,13 @@ class Cache {
* @return bool `true` if the count of files and directories has changed and the cache is updated; `false` otherwise. * @return bool `true` if the count of files and directories has changed and the cache is updated; `false` otherwise.
*/ */
public function changeFile(): bool { public function changeFile(): bool {
if (isset($this->fileCache[$this->currentDir])) { if (!isset($this->fileCache[$this->currentDir])) {
if ($this->counter[$this->currentDir] !== $this->fileCache[$this->currentDir]) { $this->fileCache[$this->currentDir] = -1;
$this->fileCache = array_merge($this->fileCache, $this->counter); }
return true;
} if ($this->counter[$this->currentDir] !== $this->fileCache[$this->currentDir]) {
$this->fileCache = array_merge($this->fileCache, $this->counter);
return true;
} }
return false; return false;
} }