Re:Accidentally exponential behavior in Spark
by lanna on Monday June 21, 2021 @05:24PM
(#27584714)
It looks like transform(tree.left) returns an Option[Tree] already (otherwise the code would not type check) so the entire if-else in the original code seems redundant and could be replaced with:
[ Parent
| on HN ]
Re:Accidentally exponential behavior in Spark
by IvanVergiliev on Monday June 21, 2021 @05:36PM
(#27584846)
Just responded to the parent comment as well - there's an additional mutable argument to the real `transform` method so it's unsafe to invoke it directly without first checking if the tree is convertible.