summaryrefslogtreecommitdiff
path: root/src/ziplist.c
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2021-06-10 20:39:33 +0800
committerGitHub <noreply@github.com>2021-06-10 15:39:33 +0300
commit0bfccc55e2df349104b34608365dc17db8e0a749 (patch)
tree1861554f79d98e4c5352d879b2e08979e69ba2f1 /src/ziplist.c
parent8a86bca5ed09094b561284fcb5b1fc416a4016dc (diff)
downloadredis-0bfccc55e2df349104b34608365dc17db8e0a749.tar.gz
Fixed some typos, add a spell check ci and others minor fix (#8890)
This PR adds a spell checker CI action that will fail future PRs if they introduce typos and spelling mistakes. This spell checker is based on blacklist of common spelling mistakes, so it will not catch everything, but at least it is also unlikely to cause false positives. Besides that, the PR also fixes many spelling mistakes and types, not all are a result of the spell checker we use. Here's a summary of other changes: 1. Scanned the entire source code and fixes all sorts of typos and spelling mistakes (including missing or extra spaces). 2. Outdated function / variable / argument names in comments 3. Fix outdated keyspace masks error log when we check `config.notify-keyspace-events` in loadServerConfigFromString. 4. Trim the white space at the end of line in `module.c`. Check: https://github.com/redis/redis/pull/7751 5. Some outdated https link URLs. 6. Fix some outdated comment. Such as: - In README: about the rdb, we used to said create a `thread`, change to `process` - dbRandomKey function coment (about the dictGetRandomKey, change to dictGetFairRandomKey) - notifyKeyspaceEvent fucntion comment (add type arg) - Some others minor fix in comment (Most of them are incorrectly quoted by variable names) 7. Modified the error log so that users can easily distinguish between TCP and TLS in `changeBindAddr`
Diffstat (limited to 'src/ziplist.c')
-rw-r--r--src/ziplist.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/ziplist.c b/src/ziplist.c
index 89270dd93..4943010ee 100644
--- a/src/ziplist.c
+++ b/src/ziplist.c
@@ -54,7 +54,7 @@
*
* The length of the previous entry, <prevlen>, is encoded in the following way:
* 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
+ * byte representing the length as an unsigned 8 bit integer. When the length
* 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.
@@ -620,7 +620,7 @@ static inline int zipEntrySafe(unsigned char* zl, size_t zlbytes, unsigned char
unsigned char *zllast = zl + zlbytes - ZIPLIST_END_SIZE;
#define OUT_OF_RANGE(p) (unlikely((p) < zlfirst || (p) > zllast))
- /* If threre's no possibility for the header to reach outside the ziplist,
+ /* If there's no possibility for the header to reach outside the ziplist,
* take the fast path. (max lensize and prevrawlensize are both 5 bytes) */
if (p >= zlfirst && p + 10 < zllast) {
ZIP_DECODE_PREVLEN(p, e->prevrawlensize, e->prevrawlen);
@@ -631,16 +631,16 @@ static inline int zipEntrySafe(unsigned char* zl, size_t zlbytes, unsigned char
/* We didn't call ZIP_ASSERT_ENCODING, so we check lensize was set to 0. */
if (unlikely(e->lensize == 0))
return 0;
- /* Make sure the entry doesn't rech outside the edge of the ziplist */
+ /* Make sure the entry doesn't reach outside the edge of the ziplist */
if (OUT_OF_RANGE(p + e->headersize + e->len))
return 0;
- /* Make sure prevlen doesn't rech outside the edge of the ziplist */
+ /* Make sure prevlen doesn't reach outside the edge of the ziplist */
if (validate_prevlen && OUT_OF_RANGE(p - e->prevrawlen))
return 0;
return 1;
}
- /* Make sure the pointer doesn't rech outside the edge of the ziplist */
+ /* Make sure the pointer doesn't reach outside the edge of the ziplist */
if (OUT_OF_RANGE(p))
return 0;
@@ -664,11 +664,11 @@ static inline int zipEntrySafe(unsigned char* zl, size_t zlbytes, unsigned char
ZIP_DECODE_LENGTH(p + e->prevrawlensize, e->encoding, e->lensize, e->len);
e->headersize = e->prevrawlensize + e->lensize;
- /* Make sure the entry doesn't rech outside the edge of the ziplist */
+ /* Make sure the entry doesn't reach outside the edge of the ziplist */
if (OUT_OF_RANGE(p + e->headersize + e->len))
return 0;
- /* Make sure prevlen doesn't rech outside the edge of the ziplist */
+ /* Make sure prevlen doesn't reach outside the edge of the ziplist */
if (validate_prevlen && OUT_OF_RANGE(p - e->prevrawlen))
return 0;
@@ -827,7 +827,7 @@ unsigned char *__ziplistCascadeUpdate(unsigned char *zl, unsigned char *p) {
/* An entry's prevlen can only increment 4 bytes. */
zipStorePrevEntryLength(p, cur.prevrawlen+delta);
}
- /* Foward to previous entry. */
+ /* Forward to previous entry. */
prevoffset -= cur.prevrawlen;
cnt--;
}