-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About ++ or -- operator #72
Comments
@Whismeril Multiline conversions from single line is complex for translator especially if it is in a loop. In SDK style VB projects System is always included. I could use Math.Min(i, Interlocked.Increment(i)), and I might do some testing with it but I also do decrements. It you want to look at the code and do a PR I will review. |
@Whismeril think about DoSomethingWithI(i++, i--,..); There are way too many places with multiple statements don't work and may not even be possible. |
I understand the difficulty to translate one line into two, especially for a loop. I only code in VB.Net in order to try helping beginners in forums. But when compiling Visual Studio returns « import missing import » to the line DoSomethingWithI(Math.Min(Interlocked.Increment(i), i - 1)) my first reaction wasn’t looking for the messing assembly, but wondering was is this strange way of coding. I tested this case in few online converters, they do the same conversion |
Change Interlocked.Increment to Threading.Interlocked.Increment to partly address issue #72 and update tests
This code
is converted like this
Interlocked.Increment(i) should work if System.Threading is imported, conversion doesn't notify that.
In
why first increment and then calcul i - 1 ?
this
does the same with one subtraction less
could be obscure for beginner, convert in 2 lines mays be easier for them
goes
and
goes
The text was updated successfully, but these errors were encountered: