Changeset fcbf101 in mainline


Ignore:
Timestamp:
2023-07-23T15:35:35Z (12 months ago)
Author:
Vojtech Horky <vojtech.horky@…>
Branches:
ticket/834-toolchain-update
Children:
6ad7f2f
Parents:
e652d8c
Message:

C++: expand loop if types are different

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/__bits/algorithm.hpp

    re652d8c rfcbf101  
    11101110                                 InputIterator2 last2)
    11111111    {
     1112        while ((first1 != last1) && (first2 != last2))
     1113        {
     1114            if (*first1 < *first2)
     1115                return true;
     1116            if (*first2 < *first1)
     1117                return false;
     1118
     1119            ++first1;
     1120            ++first2;
     1121        }
     1122
    11121123        /**
    1113          * *first1 and *first2 can have different types
    1114          * so we use a transparent comparator.
     1124         * Up until now they are same, so we have to check
     1125         * if we reached the end on one.
    11151126         */
    1116         return lexicographical_compare(
    1117             first1, last1, first2, last2,
    1118             less<void>{}
    1119         );
     1127        return (first1 == last1) && (first2 != last2);
    11201128    }
    11211129
Note: See TracChangeset for help on using the changeset viewer.