I got a task to rewrite C# code in NodeJs. Unfortunately there are some nasty oneliners in that function which I do not fully understand.
Code
int b, sign = ((b = byteBuffer.ReadByte()) >> 6) & 1, i = b & 0x3F, offset = 6; Question
I can see that there are multiple assignments, but I am not sure what values these variables are supposed to have.
Could someone explain this oneliner and/or rewrite it into a simpler to understand C# snippet?
byteBufferis aStream, can't you simply copy and paste this line of code into your C# code?bvariable, then assigns to it as part of the next variable declaration. It would make much more sense asint b = byteBuffer.ReadByte(), sign = (b >> 6) & 1, i = b & 0x3f, offset = 6;, that is, if we still want to keep it as a oneliner.