ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/gclib/GList.hh
(Generate patch)
# Line 85 | Line 85
85      bool fUnique;
86      static int DefaultCompareProc(OBJ& item1, OBJ& item2) {
87        //the comparison operators MUST be defined for OBJ class!
88 <      if ( item1 > item2) return 1;
89 <        else return (item2 > item1) ? -1 : 0 ;
88 >      if ( item2 < item1) return 1;
89 >        else return (item1 < item2) ? -1 : 0 ;
90        }
91    public:
92      typedef int CompareProc(OBJ& item1, OBJ& item2);
# Line 188 | Line 188
188      bool fUnique;
189      GCompareProc* fCompareProc; //a pointer to a Compare function
190      static int DefaultCompareProc(const pointer item1, const pointer item2) {
191 <      //the comparison operators MUST be defined for OBJ class!
192 <      if (*((OBJ*)item1) > *((OBJ*)item2)) return 1;
193 <        else if (*((OBJ*)item2) > *((OBJ*)item1)) return -1;
191 >      //operator< MUST be defined for OBJ class!
192 >      if (*((OBJ*)item2) < *((OBJ*)item1)) return 1;
193 >        else if (*((OBJ*)item1) < *((OBJ*)item2)) return -1;
194                                               else return  0;
195        }
196      void QuickSort(int L, int R);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines