-/* Copyright (c) 2009 Nicira Networks
+/* Copyright (c) 2009, 2010 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
const struct ovsdb_row *row;
row = ovsdb_table_get_row(table, &cnd->clauses[0].arg.keys[0].uuid);
- if (row && row->table == table && ovsdb_condition_evaluate(row, cnd)) {
+ if (row && row->table == table &&
+ ovsdb_condition_match_every_clause(row, cnd)) {
output_row(row, aux);
}
} else {
/* Linear scan. */
const struct ovsdb_row *row, *next;
- HMAP_FOR_EACH_SAFE (row, next, struct ovsdb_row, hmap_node,
- &table->rows) {
- if (ovsdb_condition_evaluate(row, cnd) && !output_row(row, aux)) {
+ HMAP_FOR_EACH_SAFE (row, next, hmap_node, &table->rows) {
+ if (ovsdb_condition_match_every_clause(row, cnd) &&
+ !output_row(row, aux)) {
break;
}
}
{
if (!columns || ovsdb_column_set_contains(columns, OVSDB_COL_UUID)) {
/* All the result rows are guaranteed to be distinct anyway. */
- return ovsdb_query_row_set(table, condition, results);
+ ovsdb_query_row_set(table, condition, results);
+ return;
} else {
/* Use hash table to drop duplicates. */
struct ovsdb_row_hash_node *node;
ovsdb_row_hash_init(&hash, columns);
ovsdb_query(table, condition, query_distinct_cb, &hash);
- HMAP_FOR_EACH (node, struct ovsdb_row_hash_node, hmap_node,
- &hash.rows) {
+ HMAP_FOR_EACH (node, hmap_node, &hash.rows) {
ovsdb_row_set_add_row(results, node->row);
}
ovsdb_row_hash_destroy(&hash, false);