You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And() and Xor() do basically the same operations. In both they iterate forward through the container keys, comparing them, then making a decision about should happen at each step. This could be optimized by doing both operations in a single pass. I'm not sure the best name for the method, but the signature would look like
I've given this some more thought, and I'm not sure a single method like that is the right approach. If you're trying to do addition with minimal allocation I think you want something that can do an add over the whole sequence of digits, performing container-level carries as necessary. Having gotten into the weeds of the various in-place And/Or/Xor I think there might be a clean way to do this, and I might give it a shot sometime next week.
The pseudocode for addDigit in #260
includes the two lines
And()
andXor()
do basically the same operations. In both they iterate forward through the container keys, comparing them, then making a decision about should happen at each step. This could be optimized by doing both operations in a single pass. I'm not sure the best name for the method, but the signature would look likeThe text was updated successfully, but these errors were encountered: