[SCM] OCE packaging branch, debian, updated. debian/0.11-1

Denis Barbier bouzim at gmail.com
Thu Dec 13 19:16:49 UTC 2012


The following commit has been merged in the debian branch:
commit 7aa290f58da61b320945a9a77f183685cce99a73
Author: Denis Barbier <bouzim at gmail.com>
Date:   Mon Dec 3 08:25:59 2012 +0100

    QuickSort must also work on collections which do not provide Upper() and Lower() methods

diff --git a/inc/SortTools_QuickSort.gxx b/inc/SortTools_QuickSort.gxx
index 8c513b4..53ab28f 100644
--- a/inc/SortTools_QuickSort.gxx
+++ b/inc/SortTools_QuickSort.gxx
@@ -50,19 +50,17 @@ static void SortRecursive(Array& TheArray,
     Exchange(TheArray(Middle), TheArray(Right - 1));
     Front = Left + 1;
     Back = Right - 1;
-    if(Back != TheArray.Lower()) {
+    if(Back > Left) {
       Back = Back - 1;
     }
     for(;;) {
-      while (Front < TheArray.Upper() && Comp.IsLower(TheArray(Front), Pivot)) {
+      while (Front < Back && Comp.IsLower(TheArray(Front), Pivot)) {
 	Front = Front + 1;
       }
-      while (Back > TheArray.Lower() && Comp.IsLower(Pivot, TheArray(Back))) {
+      while (Back > Front && Comp.IsLower(Pivot, TheArray(Back))) {
 	Back = Back - 1;
       }
       if(Front <= Back) {
-	if(Front == TheArray.Upper()) return;
-	if(Back == TheArray.Lower()) return;  
 	Exchange(TheArray(Front), TheArray(Back));
 	Front = Front + 1;
 	Back = Back - 1;

-- 
OCE packaging



More information about the debian-science-commits mailing list