Skip to content
Snippets Groups Projects
Commit 1d6c92e5 authored by Georgiy Lebedev's avatar Georgiy Lebedev Committed by Aleksandr Lyapunov
Browse files

memtx: refactor `index_def_new`

Since `key_def_merge` sets the merged key definition's unique part count
equal to the new part count, the extra assignment in case the index is not
unique is redundant: remove it.

NO_CHANGELOG=<refactoring>
NO_DOC=<refactoring>
NO_TEST=<refactoring>
parent bfcd8ca7
No related branches found
No related tags found
No related merge requests found
......@@ -97,13 +97,9 @@ index_def_new(uint32_t space_id, uint32_t iid, const char *name,
def->key_def = key_def_dup(key_def);
if (iid != 0) {
def->cmp_def = key_def_merge(key_def, pk_def);
if (! opts->is_unique) {
def->cmp_def->unique_part_count =
def->cmp_def->part_count;
} else {
if (opts->is_unique)
def->cmp_def->unique_part_count =
def->key_def->part_count;
}
} else {
def->cmp_def = key_def_dup(key_def);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment