nickva opened a new pull request, #5757:
URL: https://github.com/apache/couchdb/pull/5757

   Previously, we applied the same "magic" hex decoding to revision ids for 
local docs as we did for regular docs. The "magic" is to detect the case of 
binaries with length 32 and assume they are hex-encoded, and then hex-decode 
them. When encoding them we did the opposite -- checked if they are 16 bytes 
long, and if, so we hex-encoded them. That's a nice optimization to half the 
storage needed for revs internally.
   
   However, the trick above doesn't really apply to local docs. For local docs 
revision ids have the format <<"0-$N">>. Where N is a decimal number. It starts 
at 1 with the first update, then gets bumped on every update. The `0` prefix 
though never changes, it's always `0`.
   
   Since regular (non-local) docs cannot have a revision depth of 0, it's only 
the case for local docs we can detect the case of encoding local doc revision 
and skip the magic hex encoding and decoding to remove the strange corner case.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to