| 4213 | type Item = (&'a MirRelationExpr, &'a MirRelationExpr); |
| 4214 | |
| 4215 | fn next(&mut self) -> Option<Self::Item> { |
| 4216 | while let Some((expr1, expr2)) = self.todo.pop() { |
| 4217 | match (expr1, expr2) { |
| 4218 | ( |
| 4219 | MirRelationExpr::Constant { |
| 4220 | rows: rows1, |
| 4221 | typ: typ1, |
| 4222 | }, |
| 4223 | MirRelationExpr::Constant { |
| 4224 | rows: rows2, |
| 4225 | typ: typ2, |
| 4226 | }, |
| 4227 | ) => { |
| 4228 | if rows1 != rows2 || typ1 != typ2 { |
| 4229 | return Some((expr1, expr2)); |
| 4230 | } |
| 4231 | } |
| 4232 | ( |
| 4233 | MirRelationExpr::Get { |
| 4234 | id: id1, |
| 4235 | typ: typ1, |
| 4236 | access_strategy: as1, |
| 4237 | }, |
| 4238 | MirRelationExpr::Get { |
| 4239 | id: id2, |
| 4240 | typ: typ2, |
| 4241 | access_strategy: as2, |
| 4242 | }, |
| 4243 | ) => { |
| 4244 | if id1 != id2 || typ1 != typ2 || as1 != as2 { |
| 4245 | return Some((expr1, expr2)); |
| 4246 | } |
| 4247 | } |
| 4248 | ( |
| 4249 | MirRelationExpr::Let { |
| 4250 | id: id1, |
| 4251 | body: body1, |
| 4252 | value: value1, |
| 4253 | }, |
| 4254 | MirRelationExpr::Let { |
| 4255 | id: id2, |
| 4256 | body: body2, |
| 4257 | value: value2, |
| 4258 | }, |
| 4259 | ) => { |
| 4260 | if id1 != id2 { |
| 4261 | return Some((expr1, expr2)); |
| 4262 | } else { |
| 4263 | self.todo.push((body1, body2)); |
| 4264 | self.todo.push((value1, value2)); |
| 4265 | } |
| 4266 | } |
| 4267 | ( |
| 4268 | MirRelationExpr::LetRec { |
| 4269 | ids: ids1, |
| 4270 | body: body1, |
| 4271 | values: values1, |
| 4272 | limits: limits1, |