Changeset View
Changeset View
Standalone View
Standalone View
src/recurrence.cpp
Show First 20 Lines • Show All 1135 Lines • ▼ Show 20 Line(s) | 1125 | while (loop < 1000) { | |||
---|---|---|---|---|---|
1136 | ++loop; | 1136 | ++loop; | ||
1137 | // First, get the next recurrence from the RDate lists | 1137 | // First, get the next recurrence from the RDate lists | ||
1138 | SortableList<QDateTime> dates; | 1138 | SortableList<QDateTime> dates; | ||
1139 | if (nextDT < startDateTime()) { | 1139 | if (nextDT < startDateTime()) { | ||
1140 | dates << startDateTime(); | 1140 | dates << startDateTime(); | ||
1141 | } | 1141 | } | ||
1142 | 1142 | | |||
1143 | // Assume that the rdatetime list is sorted | 1143 | // Assume that the rdatetime list is sorted | ||
1144 | int i = d->mRDateTimes.findGT(nextDT); | 1144 | const auto it = std::upper_bound(d->mRDateTimes.constBegin(), d->mRDateTimes.constEnd(), nextDT); | ||
1145 | if (i >= 0) { | 1145 | if (it != d->mRDateTimes.constEnd()) { | ||
1146 | dates << d->mRDateTimes[i]; | 1146 | dates << *it; | ||
1147 | } | 1147 | } | ||
1148 | 1148 | | |||
1149 | QDateTime kdt(startDateTime()); | 1149 | QDateTime kdt(startDateTime()); | ||
1150 | for (const auto &date : d->mRDates) { | 1150 | for (const auto &date : d->mRDates) { | ||
1151 | kdt.setDate(date); | 1151 | kdt.setDate(date); | ||
1152 | if (kdt > nextDT) { | 1152 | if (kdt > nextDT) { | ||
1153 | dates << kdt; | 1153 | dates << kdt; | ||
1154 | break; | 1154 | break; | ||
▲ Show 20 Lines • Show All 401 Lines • Show Last 20 Lines |