@@ -155,34 +155,36 @@ _score_tags (const bson_t *read_tags,
155
155
156
156
count = bson_count_keys (read_tags );
157
157
158
- // Execute this block if read tags were provided, else bail and return 0 (all nodes equal)
158
+ /* Execute this block if read tags were provided, else bail and return 0 (all nodes equal) */
159
159
if (!bson_empty (read_tags ) && bson_iter_init (& iter , read_tags )) {
160
160
161
- // Iterate over array of read tag sets provided (each element is a tag set)
162
- // Tag sets are provided in order of preference so return the count of the
163
- // first set that matches the node or -1 if no set matched the node.
161
+ /*
162
+ * Iterate over array of read tag sets provided (each element is a tag set)
163
+ * Tag sets are provided in order of preference so return the count of the
164
+ * first set that matches the node or -1 if no set matched the node.
165
+ */
164
166
while (count && bson_iter_next (& iter )) {
165
167
if (BSON_ITER_HOLDS_DOCUMENT (& iter ) && bson_iter_recurse (& iter , & sub_iter )) {
166
168
node_matches_set = true;
167
169
168
- // Iterate over the key/value pairs (tags) in the current set
170
+ /* Iterate over the key/value pairs (tags) in the current set */
169
171
while (bson_iter_next (& sub_iter ) && BSON_ITER_HOLDS_UTF8 (& sub_iter )) {
170
172
key = bson_iter_key (& sub_iter );
171
173
str = bson_iter_utf8 (& sub_iter , & len );
172
174
173
- // If any of the tags do not match, this node cannot satisfy this tag set.
175
+ /* If any of the tags do not match, this node cannot satisfy this tag set. */
174
176
if (!_contains_tag (node_tags , key , str , len )) {
175
177
node_matches_set = false;
176
178
break ;
177
179
}
178
180
}
179
181
180
- // This set matched, return the count as the score
182
+ /* This set matched, return the count as the score */
181
183
if (node_matches_set ) {
182
184
return count ;
183
185
}
184
186
185
- // Decrement the score and try to match the next set.
187
+ /* Decrement the score and try to match the next set. */
186
188
count -- ;
187
189
}
188
190
}
0 commit comments