Changeset e8c235b in mainline


Ignore:
Timestamp:
2023-10-22T17:26:17Z (7 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dfb16c4
Parents:
d5409da
git-author:
Vojtech Horky <vojtech.horky@…> (2023-07-23 15:35:35)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-22 17:26:17)
Message:

C++: expand loop if types are different

File:
1 edited

Legend:

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

    rd5409da re8c235b  
    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.