summaryrefslogtreecommitdiff
path: root/src/rax.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/rax.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/rax.c')
-rw-r--r--src/rax.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/rax.c b/src/rax.c
index 0826b974a..a82b2e7ee 100644
--- a/src/rax.c
+++ b/src/rax.c
@@ -182,7 +182,7 @@ static inline void raxStackFree(raxStack *ts) {
)
/* Allocate a new non compressed node with the specified number of children.
- * If datafiled is true, the allocation is made large enough to hold the
+ * If datafield is true, the allocation is made large enough to hold the
* associated data pointer.
* Returns the new node pointer. On out of memory NULL is returned. */
raxNode *raxNewNode(size_t children, int datafield) {
@@ -259,7 +259,7 @@ raxNode *raxAddChild(raxNode *n, unsigned char c, raxNode **childptr, raxNode **
size_t curlen = raxNodeCurrentLength(n);
n->size++;
size_t newlen = raxNodeCurrentLength(n);
- n->size--; /* For now restore the orignal size. We'll update it only on
+ n->size--; /* For now restore the original size. We'll update it only on
success at the end. */
/* Alloc the new child we will link to 'n'. */
@@ -352,8 +352,8 @@ raxNode *raxAddChild(raxNode *n, unsigned char c, raxNode **childptr, raxNode **
* we don't need to do anything if there was already some padding to use. In
* that case the final destination of the pointers will be the same, however
* in our example there was no pre-existing padding, so we added one byte
- * plus thre bytes of padding. After the next memmove() things will look
- * like thata:
+ * plus there bytes of padding. After the next memmove() things will look
+ * like that:
*
* [HDR*][abde][....][Aptr][Bptr][....][Dptr][Eptr]|AUXP|
*/
@@ -653,7 +653,7 @@ int raxGenericInsert(rax *rax, unsigned char *s, size_t len, void *data, void **
* Let $SPLITPOS be the zero-based index at which, in the
* compressed node array of characters, we stopped iterating because
* there were no more keys character to match. So in the example of
- * the node "ANNIBALE", addig the string "ANNI", the $SPLITPOS is 4.
+ * the node "ANNIBALE", adding the string "ANNI", the $SPLITPOS is 4.
*
* 1. Save the current compressed node $NEXT pointer (the pointer to the
* child element, that is always present in compressed nodes).
@@ -666,7 +666,7 @@ int raxGenericInsert(rax *rax, unsigned char *s, size_t len, void *data, void **
*
* 3. Trim the current node to contain the first $SPLITPOS characters.
* As usually if the new node length is just 1, set iscompr to 0.
- * Take the iskey / associated value as it was in the orignal node.
+ * Take the iskey / associated value as it was in the original node.
* Fix the parent's reference.
*
* 4. Set the postfix node as the only child pointer of the trimmed
@@ -1102,9 +1102,9 @@ int raxRemove(rax *rax, unsigned char *s, size_t len, void **old) {
* We try to navigate upward till there are other nodes that can be
* compressed, when we reach the upper node which is not a key and has
* a single child, we scan the chain of children to collect the
- * compressable part of the tree, and replace the current node with the
+ * compressible part of the tree, and replace the current node with the
* new one, fixing the child pointer to reference the first non
- * compressable node.
+ * compressible node.
*
* Example of case "1". A tree stores the keys "FOO" = 1 and
* "FOOBAR" = 2:
@@ -1341,7 +1341,7 @@ int raxIteratorNextStep(raxIterator *it, int noup) {
if (it->node_cb && it->node_cb(&it->node))
memcpy(cp,&it->node,sizeof(it->node));
/* For "next" step, stop every time we find a key along the
- * way, since the key is lexicograhically smaller compared to
+ * way, since the key is lexicographically smaller compared to
* what follows in the sub-children. */
if (it->node->iskey) {
it->data = raxGetData(it->node);
@@ -1409,7 +1409,7 @@ int raxIteratorNextStep(raxIterator *it, int noup) {
}
/* Seek the greatest key in the subtree at the current node. Return 0 on
- * out of memory, otherwise 1. This is an helper function for different
+ * out of memory, otherwise 1. This is a helper function for different
* iteration functions below. */
int raxSeekGreatest(raxIterator *it) {
while(it->node->size) {