summaryrefslogtreecommitdiffstats
path: root/src/opt.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-09-27 12:11:15 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-09-27 12:12:46 -0400
commit52de184ba28551734e1cb13233588504ab5f62ec (patch)
tree5b3d417354e7880b97507d1e4cf01c200f6cf24f /src/opt.c
parentb395bb33e6f7d875307b18a4f9318ed0d34934ca (diff)
downloadbfs-52de184ba28551734e1cb13233588504ab5f62ec.tar.xz
Formatting fixes
Diffstat (limited to 'src/opt.c')
-rw-r--r--src/opt.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/opt.c b/src/opt.c
index 14de081..77c2798 100644
--- a/src/opt.c
+++ b/src/opt.c
@@ -535,8 +535,8 @@ static struct bfs_expr *optimize_and_expr(const struct opt_state *state, struct
expr->pure = lhs->pure && rhs->pure;
expr->always_true = lhs->always_true && rhs->always_true;
expr->always_false = lhs->always_false || rhs->always_false;
- expr->cost = lhs->cost + lhs->probability*rhs->cost;
- expr->probability = lhs->probability*rhs->probability;
+ expr->cost = lhs->cost + lhs->probability * rhs->cost;
+ expr->probability = lhs->probability * rhs->probability;
return expr;
}
@@ -606,8 +606,8 @@ static struct bfs_expr *optimize_or_expr(const struct opt_state *state, struct b
expr->pure = lhs->pure && rhs->pure;
expr->always_true = lhs->always_true || rhs->always_true;
expr->always_false = lhs->always_false && rhs->always_false;
- expr->cost = lhs->cost + (1 - lhs->probability)*rhs->cost;
- expr->probability = lhs->probability + rhs->probability - lhs->probability*rhs->probability;
+ expr->cost = lhs->cost + (1 - lhs->probability) * rhs->cost;
+ expr->probability = lhs->probability + rhs->probability - lhs->probability * rhs->probability;
return expr;
}
@@ -1078,7 +1078,6 @@ static const struct {
{eval_xattrname, 0.01},
};
-
/**
* Table of simple predicates.
*/
@@ -1331,7 +1330,7 @@ static bool reorder_expr_recursive(const struct opt_state *state, struct bfs_exp
if (expr->eval_fn == eval_and || expr->eval_fn == eval_or) {
if (lhs->pure && rhs->pure) {
float rhs_prob = expr->eval_fn == eval_and ? rhs->probability : 1.0 - rhs->probability;
- float swapped_cost = rhs->cost + rhs_prob*lhs->cost;
+ float swapped_cost = rhs->cost + rhs_prob * lhs->cost;
ret |= reorder_expr(state, expr, swapped_cost);
}
}