Permalink
Browse files

In key cardinality check use parameter name "part_count" instead of "…

…parts" for consistency.
  • Loading branch information...
1 parent eb2b0f8 commit 469694ed8cfaf985e2bec3a77576bd774dfddbed @ademakov ademakov committed Apr 29, 2012
Showing with 37 additions and 37 deletions.
  1. +3 −3 mod/box/index.h
  2. +29 −29 mod/box/index.m
  3. +5 −5 mod/box/tree.m
View
@@ -130,18 +130,18 @@ struct key_def {
:(enum iterator_type) type;
- (void) initIteratorByKey: (struct iterator *) iterator
:(enum iterator_type) type
- :(void *) key :(int) parts;
+ :(void *) key :(int) part_count;
/**
* Check key cardinality.
*/
-- (void) checkKeyParts: (int) parts :(bool) partial_key_allowed;
+- (void) checkKeyParts: (int) part_count :(bool) partial_key_allowed;
/**
* Unsafe search methods that do not check key cardinality.
*/
- (struct box_tuple *) findUnsafe: (void *) key :(int) key_cardinality;
- (void) initIteratorUnsafe: (struct iterator *) iterator
:(enum iterator_type) type
- :(void *) key :(int) parts;
+ :(void *) key :(int) part_count;
@end
struct iterator {
View
@@ -131,16 +131,16 @@ - (struct box_tuple *) max
return NULL;
}
-- (struct box_tuple *) findByKey: (void *) key :(int) parts
+- (struct box_tuple *) findByKey: (void *) key :(int) part_count
{
- [self checkKeyParts: parts :false];
- return [self findUnsafe: key :parts];
+ [self checkKeyParts: part_count :false];
+ return [self findUnsafe: key :part_count];
}
-- (struct box_tuple *) findUnsafe: (void *) key :(int) parts
+- (struct box_tuple *) findUnsafe: (void *) key :(int) part_count
{
(void) key;
- (void) parts;
+ (void) part_count;
[self subclassResponsibility: _cmd];
return NULL;
}
@@ -180,30 +180,30 @@ - (void) initIterator: (struct iterator *) iterator :(enum iterator_type) type
}
- (void) initIteratorByKey: (struct iterator *) iterator :(enum iterator_type) type
- :(void *) key :(int) parts
+ :(void *) key :(int) part_count
{
- [self checkKeyParts: parts :true];
- [self initIteratorUnsafe: iterator :type :key :parts];
+ [self checkKeyParts: part_count :true];
+ [self initIteratorUnsafe: iterator :type :key :part_count];
}
- (void) initIteratorUnsafe: (struct iterator *) iterator :(enum iterator_type) type
- :(void *) key :(int) parts
+ :(void *) key :(int) part_count
{
(void) iterator;
(void) type;
(void) key;
- (void) parts;
+ (void) part_count;
[self subclassResponsibility: _cmd];
}
-- (void) checkKeyParts: (int) parts :(bool) partial_key_allowed
+- (void) checkKeyParts: (int) part_count :(bool) partial_key_allowed
{
- if (parts > key_def->part_count)
+ if (part_count > key_def->part_count)
tnt_raise(ClientError, :ER_KEY_CARDINALITY,
- parts, key_def->part_count);
- if (!partial_key_allowed && parts < key_def->part_count)
+ part_count, key_def->part_count);
+ if (!partial_key_allowed && part_count < key_def->part_count)
tnt_raise(ClientError, :ER_EXACT_MATCH,
- parts, key_def->part_count);
+ part_count, key_def->part_count);
}
@end
@@ -316,11 +316,11 @@ - (struct iterator *) allocIterator
return (struct iterator *) it;
}
-- (void) checkKeyParts: (int) parts :(bool) partial_key_allowed
+- (void) checkKeyParts: (int) part_count :(bool) partial_key_allowed
{
/* Hash indexes never allow partial keys. */
(void) partial_key_allowed;
- [super checkKeyParts: parts :false];
+ [super checkKeyParts: part_count :false];
}
@end
@@ -367,9 +367,9 @@ - (size_t) size
return mh_size(int_hash);
}
-- (struct box_tuple *) findUnsafe: (void *) key :(int) parts
+- (struct box_tuple *) findUnsafe: (void *) key :(int) part_count
{
- (void) parts;
+ (void) part_count;
struct box_tuple *ret = NULL;
u32 num = int32_key_to_value(key);
@@ -432,9 +432,9 @@ - (void) initIterator: (struct iterator *) iterator :(enum iterator_type) type
}
- (void) initIteratorUnsafe: (struct iterator *) iterator :(enum iterator_type) type
- :(void *) key :(int) parts
+ :(void *) key :(int) part_count
{
- (void) parts;
+ (void) part_count;
if (type == ITER_REVERSE)
tnt_raise(IllegalParams, :"hash iterator is forward only");
@@ -488,9 +488,9 @@ - (size_t) size
return mh_size(int64_hash);
}
-- (struct box_tuple *) findUnsafe: (void *) key :(int) parts
+- (struct box_tuple *) findUnsafe: (void *) key :(int) part_count
{
- (void) parts;
+ (void) part_count;
struct box_tuple *ret = NULL;
u64 num = int64_key_to_value(key);
@@ -553,9 +553,9 @@ - (void) initIterator: (struct iterator *) iterator :(enum iterator_type) type
}
- (void) initIteratorUnsafe: (struct iterator *) iterator :(enum iterator_type) type
- :(void *) key :(int) parts
+ :(void *) key :(int) part_count
{
- (void) parts;
+ (void) part_count;
if (type == ITER_REVERSE)
tnt_raise(IllegalParams, :"hash iterator is forward only");
@@ -601,9 +601,9 @@ - (size_t) size
return mh_size(str_hash);
}
-- (struct box_tuple *) findUnsafe: (void *) key :(int) parts
+- (struct box_tuple *) findUnsafe: (void *) key :(int) part_count
{
- (void) parts;
+ (void) part_count;
struct box_tuple *ret = NULL;
mh_int_t k = mh_lstrptr_get(str_hash, key);
if (k != mh_end(str_hash))
@@ -670,9 +670,9 @@ - (void) initIterator: (struct iterator *) iterator :(enum iterator_type) type
- (void) initIteratorUnsafe: (struct iterator *) iterator
:(enum iterator_type) type
- :(void *) key :(int) parts
+ :(void *) key :(int) part_count
{
- (void) parts;
+ (void) part_count;
if (type == ITER_REVERSE)
tnt_raise(IllegalParams, :"hash iterator is forward only");
View
@@ -864,14 +864,14 @@ - (struct box_tuple *) max
return [self unfold: node];
}
-- (struct box_tuple *) findUnsafe: (void *) key : (int) parts
+- (struct box_tuple *) findUnsafe: (void *) key : (int) part_count
{
struct key_data *key_data
= alloca(sizeof(struct key_data) +
- _SIZEOF_SPARSE_PARTS(parts));
+ _SIZEOF_SPARSE_PARTS(part_count));
key_data->data = key;
- key_data->part_count = parts;
+ key_data->part_count = part_count;
fold_with_key_parts(key_def, key_data);
void *node = sptree_index_find(&tree, key_data);
@@ -934,13 +934,13 @@ - (void) initIterator: (struct iterator *) iterator :(enum iterator_type) type
}
- (void) initIteratorUnsafe: (struct iterator *) iterator :(enum iterator_type) type
- :(void *) key :(int) parts
+ :(void *) key :(int) part_count
{
assert(iterator->free == tree_iterator_free);
struct tree_iterator *it = tree_iterator(iterator);
it->key_data.data = key;
- it->key_data.part_count = parts;
+ it->key_data.part_count = part_count;
fold_with_key_parts(key_def, &it->key_data);
if (type == ITER_FORWARD) {

0 comments on commit 469694e

Please sign in to comment.