Skip to content

Commit 6da5d4b

Browse files
committed
Rename free_elements to owns_elements, as that is more descriptive
1 parent dac1d78 commit 6da5d4b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

php_bson.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ typedef struct {
5252
size_t allocated_size;
5353
size_t size;
5454
size_t ref_count;
55-
bool free_elements;
55+
bool owns_elements;
5656
} php_phongo_field_path;
5757

5858
typedef struct _php_phongo_field_path_map_element {
@@ -108,7 +108,7 @@ void php_phongo_bson_state_dtor(php_phongo_bson_state* state);
108108
void php_phongo_bson_state_copy_ctor(php_phongo_bson_state* dst, php_phongo_bson_state* src);
109109
void php_phongo_bson_typemap_dtor(php_phongo_bson_typemap* map);
110110

111-
php_phongo_field_path* php_phongo_field_path_alloc(bool free_elements);
111+
php_phongo_field_path* php_phongo_field_path_alloc(bool owns_elements);
112112
void php_phongo_field_path_free(php_phongo_field_path* field_path);
113113
void php_phongo_field_path_write_item_at_current_level(php_phongo_field_path* field_path, const char* element);
114114
void php_phongo_field_path_write_type_at_current_level(php_phongo_field_path* field_path, php_phongo_bson_field_path_item_types element_type);

src/bson.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,18 @@ char* php_phongo_field_path_as_string(php_phongo_field_path* field_path)
8888
return path;
8989
}
9090

91-
php_phongo_field_path* php_phongo_field_path_alloc(bool free_elements)
91+
php_phongo_field_path* php_phongo_field_path_alloc(bool owns_elements)
9292
{
9393
php_phongo_field_path* tmp = ecalloc(1, sizeof(php_phongo_field_path));
9494
tmp->ref_count = 1;
95-
tmp->free_elements = free_elements;
95+
tmp->owns_elements = owns_elements;
9696

9797
return tmp;
9898
}
9999

100100
void php_phongo_field_path_free(php_phongo_field_path* field_path)
101101
{
102-
if (field_path->free_elements) {
102+
if (field_path->owns_elements) {
103103
size_t i;
104104

105105
for (i = 0; i < field_path->size; i++) {
@@ -135,7 +135,7 @@ void php_phongo_field_path_write_item_at_current_level(php_phongo_field_path* fi
135135
{
136136
php_phongo_field_path_ensure_allocation(field_path, field_path->size);
137137

138-
if (field_path->free_elements) {
138+
if (field_path->owns_elements) {
139139
field_path->elements[field_path->size] = estrdup(element);
140140
} else {
141141
field_path->elements[field_path->size] = (char*) element;

0 commit comments

Comments
 (0)