Skip to content

Commit

Permalink
Replace scoped template to scope allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Dec 24, 2022
1 parent 93c8ed3 commit 8510c1b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import std.format : format, formattedRead;
import std.getopt;
import std.path : baseName, dirName;
import std.stdio;
import std.typecons : scoped;
import core.stdc.stdlib : exit;
import blake2d : BLAKE2D_VERSION_STRING;
import sha3d : SHA3D_VERSION_STRING;
Expand Down Expand Up @@ -450,14 +449,14 @@ int hashMmfile(const(char)[] path)

if (size)
{
auto mmfile = scoped!MmFile(cast(string)path);
scope mmfile = new MmFile(cast(string)path);

foreach (chunk; chunks(cast(ubyte[]) mmfile[], settings.bufferSize))
{
settings.hasher.put(chunk);
}
}

settings.rawHash = settings.hasher.finish();
settings.hasher.reset();
return 0;
Expand Down

0 comments on commit 8510c1b

Please sign in to comment.