Skip to content

Commit

Permalink
Merge pull request #140 from larowlan/read-only-hash-static
Browse files Browse the repository at this point in the history
Don't recalculate hash if it exists and file is unmodified
  • Loading branch information
paragonie-scott committed Sep 12, 2019
2 parents dc4d398 + 72d226c commit 5584855
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Stream/ReadOnlyFile.php
Expand Up @@ -148,6 +148,10 @@ public function close(): void
*/
public function getHash(): string
{
if ($this->hash) {
$this->toctouTest();
return $this->hash;
}
$init = $this->pos;
\fseek($this->fp, 0, SEEK_SET);

Expand Down

0 comments on commit 5584855

Please sign in to comment.