Function
write_flags
(data: WriteBuffer, flags: list[bool])
Source from the content-addressed store, hash-verified
| 5227 | |
| 5228 | |
| 5229 | def write_flags(data: WriteBuffer, flags: list[bool]) -> None: |
| 5230 | assert len(flags) <= 26, "This many flags not supported yet" |
| 5231 | packed = 0 |
| 5232 | for i, flag in enumerate(flags): |
| 5233 | if flag: |
| 5234 | packed |= 1 << i |
| 5235 | write_int(data, packed) |
| 5236 | |
| 5237 | |
| 5238 | def read_flags(data: ReadBuffer, num_flags: int) -> list[bool]: |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…