mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
gen_stub: inline computeStubHash()
This commit is contained in:
@@ -84,7 +84,7 @@ function processStubFile(string $stubFile, Context $context, bool $includeOnly =
|
||||
$legacyFile = "{$stubFilenameWithoutExtension}_legacy_arginfo.h";
|
||||
|
||||
$stubCode = file_get_contents($stubFile);
|
||||
$stubHash = computeStubHash($stubCode);
|
||||
$stubHash = sha1(str_replace("\r\n", "\n", $stubCode));
|
||||
$oldStubHash = extractStubHash($arginfoFile);
|
||||
if ($stubHash === $oldStubHash && !$context->forceParse) {
|
||||
/* Stub file did not change, do not regenerate. */
|
||||
@@ -153,10 +153,6 @@ function processStubFile(string $stubFile, Context $context, bool $includeOnly =
|
||||
}
|
||||
}
|
||||
|
||||
function computeStubHash(string $stubCode): string {
|
||||
return sha1(str_replace("\r\n", "\n", $stubCode));
|
||||
}
|
||||
|
||||
function extractStubHash(string $arginfoFile): ?string {
|
||||
if (!file_exists($arginfoFile)) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user