}
 
     head = find_equal(table, &target->flow, flow_hash(&target->flow, 0));
-    if (!target->wc.wildcards) {
+    if (flow_wildcards_is_exact(&target->wc)) {
         return head;
     }
     FOR_EACH_RULE_IN_LIST (rule, head) {
 
     memset(wc->reg_masks, 0xff, sizeof wc->reg_masks);
 }
 
+/* Returns true if 'wc' is exact-match, false if 'wc' wildcards any bits or
+ * fields. */
+bool
+flow_wildcards_is_exact(const struct flow_wildcards *wc)
+{
+    return !wc->wildcards;
+}
+
 static inline uint32_t
 combine_nw_bits(uint32_t wb1, uint32_t wb2, int shift)
 {
 
 void flow_wildcards_init(struct flow_wildcards *, uint32_t wildcards);
 void flow_wildcards_init_exact(struct flow_wildcards *);
 
+bool flow_wildcards_is_exact(const struct flow_wildcards *);
+
 bool flow_wildcards_set_nw_src_mask(struct flow_wildcards *, ovs_be32);
 bool flow_wildcards_set_nw_dst_mask(struct flow_wildcards *, ovs_be32);
 void flow_wildcards_set_reg_mask(struct flow_wildcards *,
 
 {
     size_t i;
 
-    assert(rule->cls_rule.wc.wildcards || rule->cls_rule.priority == UINT_MAX);
+    assert(!flow_wildcards_is_exact(&rule->cls_rule.wc)
+           || rule->cls_rule.priority == UINT_MAX);
     for (i = 0; i < tcls->n_rules; i++) {
         const struct cls_rule *pos = &tcls->rules[i]->cls_rule;
         if (cls_rule_equal(pos, &rule->cls_rule)) {