I have a the following Java snippet (where a
and b
are futures):
if (a.isEmpty && b.isEmpty) func(list)
else if (a.isEmpty) func(list, b)
else if (b.isEmpty) func(a, list)
else func(a, list, b)
I have all the implementations of the function 'func'. Is there a proper way to write this in Scala or is this good enough?