summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Dubbelboer <erik@dubbelboer.com>2012-04-07 14:40:29 +0200
committerantirez <antirez@gmail.com>2012-09-27 13:22:42 +0200
commit04779bdfe1bd74ea85f7dacbbbada09eb1b6c2eb (patch)
treec3b3f2cc187ba8fd7dac3e74c61151809bfaff68
parente04be06e89ac7158f0a5a79668ee734bf879c9e4 (diff)
downloadredis-04779bdfe1bd74ea85f7dacbbbada09eb1b6c2eb.tar.gz
Fixed some spelling errors in the comments
-rw-r--r--src/dict.c16
-rw-r--r--src/rdb.c2
-rw-r--r--src/t_set.c2
-rw-r--r--src/zipmap.c12
4 files changed, 16 insertions, 16 deletions
diff --git a/src/dict.c b/src/dict.c
index 69656734c..66bb983a8 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -116,8 +116,8 @@ unsigned int dictGenCaseHashFunction(const unsigned char *buf, int len) {
/* ----------------------------- API implementation ------------------------- */
-/* Reset an hashtable already initialized with ht_init().
- * NOTE: This function should only called by ht_destroy(). */
+/* Reset a hash table already initialized with ht_init().
+ * NOTE: This function should only be called by ht_destroy(). */
static void _dictReset(dictht *ht)
{
ht->table = NULL;
@@ -162,18 +162,18 @@ int dictResize(dict *d)
return dictExpand(d, minimal);
}
-/* Expand or create the hashtable */
+/* Expand or create the hash table */
int dictExpand(dict *d, unsigned long size)
{
- dictht n; /* the new hashtable */
+ dictht n; /* the new hash table */
unsigned long realsize = _dictNextPower(size);
/* the size is invalid if it is smaller than the number of
- * elements already inside the hashtable */
+ * elements already inside the hash table */
if (dictIsRehashing(d) || d->ht[0].used > size)
return DICT_ERR;
- /* Allocate the new hashtable and initialize all pointers to NULL */
+ /* Allocate the new hash table and initialize all pointers to NULL */
n.size = realsize;
n.sizemask = realsize-1;
n.table = zcalloc(realsize*sizeof(dictEntry*));
@@ -280,7 +280,7 @@ int dictAdd(dict *d, void *key, void *val)
* a value returns the dictEntry structure to the user, that will make
* sure to fill the value field as he wishes.
*
- * This function is also directly expoed to user API to be called
+ * This function is also directly exposed to user API to be called
* mainly in order to store non-pointers inside the hash value, example:
*
* entry = dictAddRaw(dict,mykey);
@@ -607,7 +607,7 @@ static int _dictKeyIndex(dict *d, const void *key)
unsigned int h, idx, table;
dictEntry *he;
- /* Expand the hashtable if needed */
+ /* Expand the hash table if needed */
if (_dictExpandIfNeeded(d) == DICT_ERR)
return -1;
/* Compute the key hash value */
diff --git a/src/rdb.c b/src/rdb.c
index 90c2ea084..fd9fcacf2 100644
--- a/src/rdb.c
+++ b/src/rdb.c
@@ -803,7 +803,7 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
}
/* This will also be called when the set was just converted
- * to regular hashtable encoded set */
+ * to regular hash table encoded set */
if (o->encoding == REDIS_ENCODING_HT) {
dictAdd((dict*)o->ptr,ele,NULL);
} else {
diff --git a/src/t_set.c b/src/t_set.c
index 08110b83c..fada1095a 100644
--- a/src/t_set.c
+++ b/src/t_set.c
@@ -187,7 +187,7 @@ unsigned long setTypeSize(robj *subject) {
}
/* Convert the set to specified encoding. The resulting dict (when converting
- * to a hashtable) is presized to hold the number of elements in the original
+ * to a hash table) is presized to hold the number of elements in the original
* set. */
void setTypeConvert(robj *setobj, int enc) {
setTypeIterator *si;
diff --git a/src/zipmap.c b/src/zipmap.c
index 1f11fd429..d9b7c8b31 100644
--- a/src/zipmap.c
+++ b/src/zipmap.c
@@ -52,15 +52,15 @@
* <len> lengths are encoded in a single value or in a 5 bytes value.
* If the first byte value (as an unsigned 8 bit value) is between 0 and
* 252, it's a single-byte length. If it is 253 then a four bytes unsigned
- * integer follows (in the host byte ordering). A value fo 255 is used to
+ * integer follows (in the host byte ordering). A value of 255 is used to
* signal the end of the hash. The special value 254 is used to mark
* empty space that can be used to add new key/value pairs.
*
- * <free> is the number of free unused bytes
- * after the string, resulting from modification of values associated to a
- * key (for instance if "foo" is set to "bar', and later "foo" will be se to
- * "hi", I'll have a free byte to use if the value will enlarge again later,
- * or even in order to add a key/value pair if it fits.
+ * <free> is the number of free unused bytes after the string, resulting
+ * from modification of values associated to a key. For instance if "foo"
+ * is set to "bar", and later "foo" will be set to "hi", it will have a
+ * free byte to use if the value will enlarge again later, or even in
+ * order to add a key/value pair if it fits.
*
* <free> is always an unsigned 8 bit number, because if after an
* update operation there are more than a few free bytes, the zipmap will be