mirror of https://github.com/procxx/kepka.git
parent
4837117719
commit
eb099c70e6
|
@ -654,7 +654,7 @@ void PeerListContent::removeFromSearchIndex(not_null<PeerListRow*> row) {
|
||||||
auto it = _searchIndex.find(ch);
|
auto it = _searchIndex.find(ch);
|
||||||
if (it != _searchIndex.cend()) {
|
if (it != _searchIndex.cend()) {
|
||||||
auto &entry = it->second;
|
auto &entry = it->second;
|
||||||
entry.erase(std::remove(entry.begin(), entry.end(), row), entry.end());
|
entry.erase(ranges::remove(entry, row), end(entry));
|
||||||
if (entry.empty()) {
|
if (entry.empty()) {
|
||||||
_searchIndex.erase(it);
|
_searchIndex.erase(it);
|
||||||
}
|
}
|
||||||
|
@ -666,6 +666,7 @@ void PeerListContent::removeFromSearchIndex(not_null<PeerListRow*> row) {
|
||||||
|
|
||||||
void PeerListContent::prependRow(std::unique_ptr<PeerListRow> row) {
|
void PeerListContent::prependRow(std::unique_ptr<PeerListRow> row) {
|
||||||
Expects(row != nullptr);
|
Expects(row != nullptr);
|
||||||
|
|
||||||
if (_rowsById.find(row->id()) == _rowsById.cend()) {
|
if (_rowsById.find(row->id()) == _rowsById.cend()) {
|
||||||
addRowEntry(row.get());
|
addRowEntry(row.get());
|
||||||
_rows.insert(_rows.begin(), std::move(row));
|
_rows.insert(_rows.begin(), std::move(row));
|
||||||
|
@ -729,11 +730,11 @@ void PeerListContent::removeRow(not_null<PeerListRow*> row) {
|
||||||
|
|
||||||
_rowsById.erase(row->id());
|
_rowsById.erase(row->id());
|
||||||
auto &byPeer = _rowsByPeer[row->peer()];
|
auto &byPeer = _rowsByPeer[row->peer()];
|
||||||
byPeer.erase(std::remove(byPeer.begin(), byPeer.end(), row), byPeer.end());
|
byPeer.erase(ranges::remove(byPeer, row), end(byPeer));
|
||||||
removeFromSearchIndex(row);
|
removeFromSearchIndex(row);
|
||||||
_filterResults.erase(
|
_filterResults.erase(
|
||||||
std::find(_filterResults.begin(), _filterResults.end(), row),
|
ranges::remove(_filterResults, row),
|
||||||
_filterResults.end());
|
end(_filterResults));
|
||||||
removeRowAtIndex(eraseFrom, index);
|
removeRowAtIndex(eraseFrom, index);
|
||||||
|
|
||||||
restoreSelection();
|
restoreSelection();
|
||||||
|
|
Loading…
Reference in New Issue