Last active
August 20, 2025 12:40
-
-
Save jepler/887804942e7417c718e3742f8192052b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/coverage/sqldata.py b/coverage/sqldata.py | |
| index 5e3d6790..2b5dae1f 100644 | |
| --- a/coverage/sqldata.py | |
| +++ b/coverage/sqldata.py | |
| @@ -126,15 +126,17 @@ class NumbitsUnionAgg: | |
| """SQLite aggregate function for computing union of numbits.""" | |
| def __init__(self) -> None: | |
| - self.result = b"" | |
| + self.result = 0 | |
| + self.len = 0 | |
| def step(self, value: bytes) -> None: | |
| """Process one value in the aggregation.""" | |
| - self.result = numbits_union(self.result, value) | |
| + self.result |= int.from_bytes(value, "little") | |
| + self.len = max(self.len, len(value)) | |
| def finalize(self) -> bytes: | |
| """Return the final aggregated result.""" | |
| - return self.result | |
| + return self.result.to_bytes(self.len, "little") | |
| class CoverageData: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment