Note that we always have x --[ v ]-> x leaves x unchanged. Therefore, we should only do the necessary precondition checks in such cases (especially useful for only when).
Related: when we check a condition like only when x = y, we generate:
x --[ y ]-> x
y --[ x ]-> y
This is correct, but it is inefficient if x and y are not fungible; in this case, we generate:
require(x == y, ...);
require(y == x, ...);
which is redundant.
Note that we always have
x --[ v ]-> xleavesxunchanged. Therefore, we should only do the necessary precondition checks in such cases (especially useful foronly when).Related: when we check a condition like
only when x = y, we generate:This is correct, but it is inefficient if
xandyare not fungible; in this case, we generate:which is redundant.