Seems like a wasteful allocation. I didn't comment on the `clear()` since it's (hopefully) infrequent. Is there no better way to write zeroes?