mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-11 01:10:13 +00:00
Merge branch 'dev' of https://bitbucket.org/johnprestonmail/telegram-desktop into dev
This commit is contained in:
commit
58f0dbe2a4
@ -75,7 +75,10 @@ inline bool operator!=(const Type &a, const Type &b) {
|
||||
namespace data {
|
||||
|
||||
inline int pxAdjust(int value, int scale) {
|
||||
return qRound((value * scale / 4.) + (value > 0 ? -0.01 : 0.01));
|
||||
if (value < 0) {
|
||||
return -pxAdjust(-value, scale);
|
||||
}
|
||||
return static_cast<int>(std::floor((value * scale / 4.) + 0.1));
|
||||
}
|
||||
|
||||
struct point {
|
||||
|
@ -103,7 +103,12 @@ public:
|
||||
void notify(Flags flags, Args&&... args) {
|
||||
t_assert(started());
|
||||
|
||||
for (auto &entry : _list->entries) {
|
||||
auto &entries = _list->entries;
|
||||
// This way of iterating (i < entries.size() should be used
|
||||
// because some entries can be removed from the end of the
|
||||
// entries list while the loop is still running.
|
||||
for (int i = 0; i < entries.size(); ++i) {
|
||||
auto &entry = entries[i];
|
||||
if (!entry.handler.isNull() && (flags & entry.flags)) {
|
||||
entry.handler.call(std_::forward<Args>(args)...);
|
||||
}
|
||||
@ -131,7 +136,7 @@ private:
|
||||
|
||||
t_assert(that->started());
|
||||
|
||||
auto &entries(that->_list->entries);
|
||||
auto &entries = that->_list->entries;
|
||||
if (entries.size() <= connectionIndex) return;
|
||||
|
||||
if (entries.size() == connectionIndex + 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user