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

Move to std::optional.

This commit is contained in:
John Preston
2018-09-21 19:28:46 +03:00
parent 850efbde95
commit 2e5a0e056c
115 changed files with 632 additions and 672 deletions

View File

@@ -127,7 +127,7 @@ void Instance::playlistUpdated(not_null<Data*> data) {
const auto fullId = data->current.contextId();
data->playlistIndex = data->playlistSlice->indexOf(fullId);
} else {
data->playlistIndex = base::none;
data->playlistIndex = std::nullopt;
}
data->playlistChanges.fire({});
}
@@ -146,7 +146,7 @@ bool Instance::validPlaylist(not_null<Data*> data) {
return [&](const SparseIdsMergedSlice &data) {
return inSameDomain(a, b)
? data.distance(a, b)
: base::optional<int>();
: std::optional<int>();
};
};
@@ -180,14 +180,14 @@ void Instance::validatePlaylist(not_null<Data*> data) {
playlistUpdated(data);
}, data->playlistLifetime);
} else {
data->playlistSlice = base::none;
data->playlistSliceKey = data->playlistRequestedKey = base::none;
data->playlistSlice = std::nullopt;
data->playlistSliceKey = data->playlistRequestedKey = std::nullopt;
playlistUpdated(data);
}
}
auto Instance::playlistKey(not_null<Data*> data) const
-> base::optional<SliceKey> {
-> std::optional<SliceKey> {
const auto contextId = data->current.contextId();
const auto history = data->history;
if (!contextId || !history || !IsServerMsgId(contextId.msg)) {