Removed unused MsgRange from SparseIdsSlice.

This commit is contained in:
23rd 2021-06-30 22:23:49 +03:00
parent 18b48df9ce
commit baa47bde7f
2 changed files with 0 additions and 10 deletions

View file

@ -12,12 +12,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
SparseIdsSlice::SparseIdsSlice( SparseIdsSlice::SparseIdsSlice(
const base::flat_set<MsgId> &ids, const base::flat_set<MsgId> &ids,
MsgRange range,
std::optional<int> fullCount, std::optional<int> fullCount,
std::optional<int> skippedBefore, std::optional<int> skippedBefore,
std::optional<int> skippedAfter) std::optional<int> skippedAfter)
: _ids(ids) : _ids(ids)
, _range(range)
, _fullCount(fullCount) , _fullCount(fullCount)
, _skippedBefore(skippedBefore) , _skippedBefore(skippedBefore)
, _skippedAfter(skippedAfter) { , _skippedAfter(skippedAfter) {
@ -245,7 +243,6 @@ bool SparseIdsSliceBuilder::removeOne(MsgId messageId) {
bool SparseIdsSliceBuilder::removeAll() { bool SparseIdsSliceBuilder::removeAll() {
_ids = {}; _ids = {};
_range = { 0, ServerMaxMsgId };
_fullCount = 0; _fullCount = 0;
_skippedBefore = 0; _skippedBefore = 0;
_skippedAfter = 0; _skippedAfter = 0;
@ -254,9 +251,6 @@ bool SparseIdsSliceBuilder::removeAll() {
bool SparseIdsSliceBuilder::invalidateBottom() { bool SparseIdsSliceBuilder::invalidateBottom() {
_fullCount = _skippedAfter = std::nullopt; _fullCount = _skippedAfter = std::nullopt;
if (_range.till == ServerMaxMsgId) {
_range.till = _ids.empty() ? _range.from : _ids.back();
}
checkInsufficient(); checkInsufficient();
return true; return true;
} }
@ -389,7 +383,6 @@ void SparseIdsSliceBuilder::requestMessagesCount() {
SparseIdsSlice SparseIdsSliceBuilder::snapshot() const { SparseIdsSlice SparseIdsSliceBuilder::snapshot() const {
return SparseIdsSlice( return SparseIdsSlice(
_ids, _ids,
_range,
_fullCount, _fullCount,
_skippedBefore, _skippedBefore,
_skippedAfter); _skippedAfter);

View file

@ -21,7 +21,6 @@ public:
SparseIdsSlice() = default; SparseIdsSlice() = default;
SparseIdsSlice( SparseIdsSlice(
const base::flat_set<MsgId> &ids, const base::flat_set<MsgId> &ids,
MsgRange range,
std::optional<int> fullCount, std::optional<int> fullCount,
std::optional<int> skippedBefore, std::optional<int> skippedBefore,
std::optional<int> skippedAfter); std::optional<int> skippedAfter);
@ -37,7 +36,6 @@ public:
private: private:
base::flat_set<MsgId> _ids; base::flat_set<MsgId> _ids;
MsgRange _range;
std::optional<int> _fullCount; std::optional<int> _fullCount;
std::optional<int> _skippedBefore; std::optional<int> _skippedBefore;
std::optional<int> _skippedAfter; std::optional<int> _skippedAfter;
@ -205,7 +203,6 @@ private:
Key _key; Key _key;
base::flat_set<MsgId> _ids; base::flat_set<MsgId> _ids;
MsgRange _range;
std::optional<int> _fullCount; std::optional<int> _fullCount;
std::optional<int> _skippedBefore; std::optional<int> _skippedBefore;
std::optional<int> _skippedAfter; std::optional<int> _skippedAfter;