Repository: valkey-io/valkey
File: src/server.c (C)

Code before:
    .no_value = 1,     /* no values in this dict */
    .keys_are_odd = 1  /* an SDS string is always an odd pointer */
};

/* Sorted sets hash (note: a skiplist is used in addition to the hash table) */
dictType zsetDictType = {
    dictSdsHash,       /* hash function */
    NULL,              /* key dup */
    NULL,              /* val dup */
    dictSdsKeyCompare, /* key compare */
    NULL,              /* Note: SDS string shared & freed by skiplist */
    NULL,              /* val destructor */
    NULL,              /* allow to expand */
};

/* Db->dict, keys are sds strings, vals are Objects. */
dictType dbDictType = {
    dictSdsHash,          /* hash function */
    NULL,                 /* key dup */
    NULL,                 /* val dup */
    dictSdsKeyCompare,    /* key compare */
    NULL,                 /* key is embedded in the dictEntry and freed internally */
    dictObjectDestructor, /* val destructor */
    dictResizeAllowed,    /* allow to resize */
    .keyLen = dictSdsKeyLen,
    .keyToBytes = dictSdsKeyToBytes,
    .embedded_entry = 1
};

/* Db->expires */
dictType dbExpiresDictType = {
    dictSdsHash,       /* hash function */
    NULL,              /* key dup */
    NULL,              /* val dup */
    dictSdsKeyCompare, /* key compare */
    NULL,              /* key destructor */
    NULL,              /* val destructor */
    dictResizeAllowed, /* allow to resize */
};

/* Command table. sds string -> command struct pointer. */
dictType commandTableDictType = {
    dictSdsCaseHash,       /* hash function */
    NULL,                  /* key dup */
    NULL,                  /* val dup */
    dictSdsKeyCaseCompare, /* key compare */
    dictSdsDestructor,     /* key destructor */
    NULL,                  /* val destructor */
    NULL                   /* allow to expand */
};


Review comment (suggestion):
```suggestion
    .keyCopy = dictSdsKeyCopy,
```

Code after:
};

/* Db->dict, keys are sds strings, vals are Objects. */
dictType dbDictType = {
    dictSdsHash,          /* hash function */
    NULL,                 /* key dup */
    dictSdsKeyCompare,    /* key compare */
    NULL,                 /* key is embedded in the dictEntry and freed internally */
    dictObjectDestructor, /* val destructor */
    dictResizeAllowed,    /* allow to resize */
    .embedKey = dictSdsEmbedKey,
    .embedded_entry = 1,
};

/* Db->expires */
dictType dbExpiresDictType = {
    dictSdsHash,       /* hash function */
    NULL,              /* key dup */
    dictSdsKeyCompare, /* key compare */
    NULL,              /* key destructor */
    NULL,              /* val destructor */
    dictResizeAllowed, /* allow to resize */
};

/* Command table. sds string -> command struct pointer. */
dictType commandTableDictType = {
    dictSdsCaseHash,       /* hash function */
    NULL,                  /* key dup */
    dictSdsKeyCaseCompare, /* key compare */
    dictSdsDestructor,     /* key destructor */
    NULL,                  /* val destructor */
    NULL                   /* allow to expand */
};

/* Hash type hash table (note that small hashes are represented with listpacks) */
dictType hashDictType = {
    dictSdsHash,       /* hash function */
    NULL,              /* key dup */
    dictSdsKeyCompare, /* key compare */
    dictSdsDestructor, /* key destructor */
    dictSdsDestructor, /* val destructor */
    NULL,              /* allow to expand */
};

/* Dict type without destructor */
dictType sdsReplyDictType = {
    dictSdsHash,       /* hash function */
    NULL,              /* key dup */
    dictSdsKeyCompare, /* key compare */
    NULL,              /* key destructor */
    NULL,              /* val destructor */