diff options
author | antirez <antirez@gmail.com> | 2018-02-23 12:19:30 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2018-02-23 12:19:35 +0100 |
commit | 813960dbdd86b88b509b2946dbaa023e0ae8b1b9 (patch) | |
tree | 898f6a7298fc8ebea5e5822c175f5e844594ac73 | |
parent | ffde73c57d0aa5cd58869c13cb1b76d6c27ef5b7 (diff) | |
download | redis-813960dbdd86b88b509b2946dbaa023e0ae8b1b9.tar.gz |
Fix ziplist prevlen encoding description. See #4705.
-rw-r--r-- | src/ziplist.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ziplist.c b/src/ziplist.c index 4d2ee821e..ea27db7fb 100644 --- a/src/ziplist.c +++ b/src/ziplist.c @@ -53,20 +53,20 @@ * <prevlen> <encoding> * * The length of the previous entry, <prevlen>, is encoded in the following way: - * If this length is smaller than 255 bytes, it will only consume a single + * If this length is smaller than 254 bytes, it will only consume a single * byte representing the length as an unsinged 8 bit integer. When the length - * is greater than or equal to 255, it will consume 5 bytes. The first byte is - * set to 255 (FF) to indicate a larger value is following. The remaining 4 + * is greater than or equal to 254, it will consume 5 bytes. The first byte is + * set to 254 (FE) to indicate a larger value is following. The remaining 4 * bytes take the length of the previous entry as value. * * So practically an entry is encoded in the following way: * - * <prevlen from 0 to 254> <encoding> <entry> + * <prevlen from 0 to 253> <encoding> <entry> * - * Or alternatively if the previous entry length is greater than 254 bytes + * Or alternatively if the previous entry length is greater than 253 bytes * the following encoding is used: * - * 0xFF <4 bytes unsigned little endian prevlen> <encoding> <entry> + * 0xFE <4 bytes unsigned little endian prevlen> <encoding> <entry> * * The encoding field of the entry depends on the content of the * entry. When the entry is a string, the first 2 bits of the encoding first |