I changed some c # code on vb.net and converter. Tilik.com started it:
i--;
In this:
System.Math.Max (System.Threading.Interlocked.Decrement (i), i + 1)
is to return the current value of
The current terminology for C # in code> i -
i
(i.e., the value is before the decrease) and then a <<> codeSo, we need to convert him to VB. We can not use
i - = 1
because it does not return the current value ofi
before it decreases. Therefore, we need an operation that reducesi
, but the value ofi
comes back to the value, like something:Function DoPostDecrement (I as integer) ByRef integer as I - = 1 return i + 1 termination function
But to write a method to perform this To avoid being suggested to use the following:
System.Math.Max (someValueThatIsEqualToiMinusOne, someValueThatIsEqualtoiBeforeTheDecrement)
but V B.NET will not use you to replace
me - = 1
ori = i - 1
in thesome valueIsquateTimionOn
. However,System.Threading.Interlocked.Decrement (i)
is valid and the value ofi-1
is equal. Once you have done that, because the parameter is correct, thesomeValueThatIsEqualtoiBeforeTheDecrement
is left to be evaluated toi + 1
(execute on that point decreasingi + 1
is the decreasing value.Note that the above method is
DoPostDecrement
andSystem.Math.Max, System. Threading.Interlocked.Decrement
creation can be different semantically in a multi-reference context.
No comments:
Post a Comment