Skip to main content

hoist_common_operand

Function hoist_common_operand 

Source
pub fn hoist_common_operand(term: ZipTerm) -> ZipTerm
Expand description

term with every select whose two arms apply one operator to a common operand rewritten to apply it once, to the select of what differs — c ? x − a : x − b becomes x − (c ? a : b), and the same for +, × and a common right operand. Exact for every value: both forms apply the same operator to the same operands of the arm taken.