]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stick-table: use smp_expr_output_type() to retrieve the output type of a ...
authorThierry FOURNIER <tfournier@exceliance.fr>
Wed, 27 Nov 2013 14:30:55 +0000 (15:30 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 2 Dec 2013 22:31:32 +0000 (23:31 +0100)
It's just a minor cleanup.

src/stick_table.c

index b1d88276d4f3d3725cabf6a6fcdcedc06baf8f3c..0eac3e1d98dce62ce693563bc9a5ea6596855d76 100644 (file)
@@ -665,19 +665,15 @@ struct stktable_key *stktable_fetch_key(struct stktable *t, struct proxy *px, st
  */
 int stktable_compatible_sample(struct sample_expr *expr, unsigned long table_type)
 {
+       int out_type;
+
        if (table_type >= STKTABLE_TYPES)
                return 0;
 
-       if (LIST_ISEMPTY(&expr->conv_exprs)) {
-               if (!sample_to_key[expr->fetch->out_type][table_type])
-                       return 0;
-       } else {
-               struct sample_conv_expr *conv_expr;
-               conv_expr = LIST_PREV(&expr->conv_exprs, typeof(conv_expr), list);
+       out_type = smp_expr_output_type(expr);
+       if (!sample_to_key[out_type][table_type])
+               return 0;
 
-               if (!sample_to_key[conv_expr->conv->out_type][table_type])
-                       return 0;
-       }
        return 1;
 }