I’m porting Amp’s DiffLib implementation to C# and stumbled upon this very line (#114):
@b2j[@a[i,1]] && @b2j[@a[i,1]].each do |j|
Now, I got everything else ported and most tests seem to pass but I still do not understand what is this && here for. I assume it is something along those lines in C#:
if(b2j.ContainsKey(a[i]))
{
foreach(var j in b2j[a[i]])
But still not particularly sure about that.
It says that if
@b2j[@a[i,1]]is notniland notfalse, then continue and do an iteration witheachit. It is used to control the flow of the program in this case.