2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Use ranges:: algorithms instead of base::

This commit is contained in:
John Preston
2017-11-20 16:23:20 +04:00
parent bc7c88c511
commit ac99318f34
28 changed files with 751 additions and 596 deletions

View File

@@ -51,10 +51,10 @@ public:
bool canAddItem(not_null<const HistoryItem*> item) const {
return (ComputeType(item) == _type && item->date.date() == _date);
}
void addItem(HistoryItem *item) {
void addItem(not_null<HistoryItem*> item) {
Expects(canAddItem(item));
_items.push_back(item);
base::sort(_items, [](HistoryItem *a, HistoryItem *b) {
ranges::sort(_items, [](not_null<HistoryItem*> a, auto b) {
return (a->id > b->id);
});
refreshStatus();
@@ -116,7 +116,7 @@ private:
void refreshStatus();
static Type ComputeType(not_null<const HistoryItem*> item);
std::vector<HistoryItem*> _items;
std::vector<not_null<HistoryItem*>> _items;
QDate _date;
Type _type;