small loop condition adjustment
authorRafael Teixeira <monoman@gmail.com>
Fri, 17 Sep 2004 11:32:38 +0000 (11:32 -0000)
committerRafael Teixeira <monoman@gmail.com>
Fri, 17 Sep 2004 11:32:38 +0000 (11:32 -0000)
svn path=/trunk/mcs/; revision=34001

mcs/class/Microsoft.VisualBasic/Microsoft.VisualBasic/Microsoft.VisualBasic.CompilerServices/Utils.cs

index 3a10c0c47ede7bcf12a39333dd13ffaeac3b687d..d6dc5c86ba78bc9afa11757ba58f202991f6e318 100644 (file)
@@ -415,8 +415,8 @@ namespace Microsoft.VisualBasic.CompilerServices {
                                long destinationLengthInLastRank = destination.GetLongLength(totalRanks - 1);
                                if (destinationLengthInLastRank > 0) {
                                        long lengthToCopyInLastRank = Math.Min(destinationLengthInLastRank, sourceLengthInLastRank);
-                                       long lowerRankBlocksToCopy = ((source.LongLength / sourceLengthInLastRank) - 1);
-                                       for (long block = 0; block <= lowerRankBlocksToCopy; block++)
+                                       long lowerRankBlocksToCopy = source.LongLength / sourceLengthInLastRank;
+                                       for (long block = 0; block < lowerRankBlocksToCopy; block++)
                                                Array.Copy(source, (block * sourceLengthInLastRank), destination, (block * destinationLengthInLastRank), lengthToCopyInLastRank);
                                }
                        }
@@ -444,8 +444,8 @@ namespace Microsoft.VisualBasic.CompilerServices {
                                int destinationLengthInLastRank = destination.GetLength(totalRanks - 1);
                                if (destinationLengthInLastRank > 0) {
                                        int lengthToCopyInLastRank = Math.Min(destinationLengthInLastRank, sourceLengthInLastRank);
-                                       int lowerRankBlocksToCopy = ((source.Length / sourceLengthInLastRank) - 1);
-                                       for (int block = 0; block <= lowerRankBlocksToCopy; block++)
+                                       int lowerRankBlocksToCopy = source.Length / sourceLengthInLastRank;
+                                       for (int block = 0; block < lowerRankBlocksToCopy; block++)
                                                Array.Copy(source, (block * sourceLengthInLastRank), destination, (block * destinationLengthInLastRank), lengthToCopyInLastRank);
                                }
                        }