3 ms·
> Finally, we do a masked add. We pass c twice: bytes from the first c are copied to the result when is_uppper is false, and when is_upper is true the result is
by LelouBil 2y ago
> Finally, we do a masked add. We pass c twice: bytes from the first c are copied to the result when is_uppper is false, and when is_upper is true the result is c + to_upper.
Is that an error in the post ? Shouldnt it do the addition when is_upper is false and copy the same when it is true ?
- jmalicki 2y agoThe operation is `tolower` Capital a is 0x40, lowercase is 0x60. The addition of 0x20 needs to happen when is_upper is true.
- fanf2 2y agoD'oh, I must have seen your comment 10 times before I realised the to_upper variable is named backwards and should be called to_lower. Thanks for pointing out that it was confusing! I've fixed the post and the code.