From ecc403a8fa9cdbd53ccc1baa686ed6cb3b608c50 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Thu, 15 May 2025 14:30:52 -0400 Subject: [PATCH] gen_stub: inline `computeStubHash()` --- build/gen_stub.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/build/gen_stub.php b/build/gen_stub.php index 19e60a16e06..cb9b1590f94 100755 --- a/build/gen_stub.php +++ b/build/gen_stub.php @@ -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;