Author: sudha
Date: 2005-05-05 06:14:09 -0400 (Thu, 05 May 2005)
New Revision: 44069
Modified:
trunk/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ChangeLog
trunk/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs
Log:
* FlowControl.cs : Fixed the methods 'ForNextCheck*'
Modified:
trunk/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ChangeLog
===================================================================
---
trunk/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ChangeLog
2005-05-05 10:12:30 UTC (rev 44068)
+++
trunk/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/ChangeLog
2005-05-05 10:14:09 UTC (rev 44069)
@@ -1,3 +1,6 @@
+2005-05-05 Satya Sudha K <[EMAIL PROTECTED]>
+ * FlowControl.cs : Fixed checks in the methods 'ForNextCheck*'
+
2005-05-04 Satya Sudha K <[EMAIL PROTECTED]>
* LateBinding.cs: Removed the 'CopyBack' param from the 'LateSet'
method (to make it consistent with vbc)
* ObjectType.cs : Implemented the 'GetWidestType' method
Modified:
trunk/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs
===================================================================
---
trunk/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs
2005-05-05 10:12:30 UTC (rev 44068)
+++
trunk/mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/FlowControl.cs
2005-05-05 10:14:09 UTC (rev 44069)
@@ -66,8 +66,10 @@
*/
public static bool ForNextCheckR4(float count, float limit,
float StepValue) {
bool positiveStep = StepValue > 0.0F;
- bool isCountSmallThenLimit = count <= limit;
- return positiveStep? isCountSmallThenLimit :
!isCountSmallThenLimit;
+ if (positiveStep)
+ return count <= limit;
+ else
+ return count >= limit;
}
/**
@@ -81,8 +83,10 @@
*/
public static bool ForNextCheckR8(double count, double limit,
double StepValue) {
bool positiveStep = StepValue > 0.0;
- bool isCountSmallThenLimit = count <= limit;
- return positiveStep? isCountSmallThenLimit :
!isCountSmallThenLimit;
+ if (positiveStep)
+ return count <= limit;
+ else
+ return count >= limit;
}
/**
@@ -95,9 +99,11 @@
* @return boolean True of the for next loop can continue and
false otherwise.
*/
public static bool ForNextCheckDec(Decimal count, Decimal
limit, Decimal StepValue) {
- bool positiveStep = StepValue.CompareTo(Decimal.Zero) <
0;
- bool isCountSmallThenLimit = count.CompareTo(limit) >=
0;
- return positiveStep? isCountSmallThenLimit :
!isCountSmallThenLimit;
+ bool positiveStep = StepValue.CompareTo(Decimal.Zero) >
0;
+ if (positiveStep)
+ return (count.CompareTo(limit) <= 0);
+ else
+ return (limit.CompareTo(count) <= 0);
}
/**
@@ -370,8 +376,10 @@
if (iComparable != null) {
int i = iComparable.CompareTo(LoopFor.Limit);
- bool isCountSmallThenLimit = i<=0;
- return LoopFor.PositiveStep ?
isCountSmallThenLimit : !isCountSmallThenLimit;
+ if (LoopFor.PositiveStep)
+ return i <= 0;
+ else
+ return i >= 0;
}
throw new ArgumentException("Argument_IComparable2 loop
control variable"); // + Utils.VBFriendlyName(LoopFor.Counter)));
//TODO: verify this and the above are the same
and remove.
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches