From 9259479c421ede2348d756f739b5690578ad4a38 Mon Sep 17 00:00:00 2001 From: nicoo Date: Fri, 13 Sep 2024 14:11:34 +0000 Subject: [PATCH] maintainers/scripts/sha-to-sri: minor efficiency improvement of the `Nix32` decoder --- maintainers/scripts/sha-to-sri.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/maintainers/scripts/sha-to-sri.py b/maintainers/scripts/sha-to-sri.py index e31091242341..971c24fe1fff 100755 --- a/maintainers/scripts/sha-to-sri.py +++ b/maintainers/scripts/sha-to-sri.py @@ -59,8 +59,7 @@ class Nix32(Encoding): def decode(self, s: str): assert len(s) == self.length - out = [0 for _ in range(self.n)] - # TODO: Do better than a list of byte-sized ints + out = bytearray(self.n) for n, c in enumerate(reversed(s)): digit = self.inverted[c]