Skip to content

Commit f51b78a

Browse files
gen_stub: inline computeStubHash()
1 parent 5e597c3 commit f51b78a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

build/gen_stub.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function processStubFile(string $stubFile, Context $context, bool $includeOnly =
8484
$legacyFile = "{$stubFilenameWithoutExtension}_legacy_arginfo.h";
8585

8686
$stubCode = file_get_contents($stubFile);
87-
$stubHash = computeStubHash($stubCode);
87+
$stubHash = sha1(str_replace("\r\n", "\n", $stubCode));
8888
$oldStubHash = extractStubHash($arginfoFile);
8989
if ($stubHash === $oldStubHash && !$context->forceParse) {
9090
/* Stub file did not change, do not regenerate. */
@@ -153,10 +153,6 @@ function processStubFile(string $stubFile, Context $context, bool $includeOnly =
153153
}
154154
}
155155

156-
function computeStubHash(string $stubCode): string {
157-
return sha1(str_replace("\r\n", "\n", $stubCode));
158-
}
159-
160156
function extractStubHash(string $arginfoFile): ?string {
161157
if (!file_exists($arginfoFile)) {
162158
return null;

0 commit comments

Comments
 (0)