mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 03:12:56 +00:00
use foreach() for iteration in QEventDispatcherUNIXPrivate::doSelect()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
4413cf7dbf
commit
58ae4ed531
1 changed files with 5 additions and 12 deletions
|
@ -142,13 +142,8 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
|
|||
timeval tm;
|
||||
tm.tv_sec = tm.tv_usec = 0l;
|
||||
|
||||
for (int type = 0; type < 3; ++type) {
|
||||
QSockNotType::List &list = sn_vec[type].list;
|
||||
if (list.size() == 0)
|
||||
continue;
|
||||
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
QSockNot *sn = list[i];
|
||||
for (int type = 0; type < 3; type++) {
|
||||
foreach (QSockNot *sn, sn_vec[type].list) {
|
||||
|
||||
FD_ZERO(&fdset);
|
||||
FD_SET(sn->fd, &fdset);
|
||||
|
@ -190,11 +185,9 @@ int QEventDispatcherUNIXPrivate::doSelect(QEventLoop::ProcessEventsFlags flags,
|
|||
if (! (flags & QEventLoop::ExcludeSocketNotifiers) && nsel > 0 && sn_highest >= 0) {
|
||||
// if select says data is ready on any socket, then set the socket notifier
|
||||
// to pending
|
||||
for (int i=0; i<3; i++) {
|
||||
QSockNotType::List &list = sn_vec[i].list;
|
||||
for (int j = 0; j < list.size(); ++j) {
|
||||
QSockNot *sn = list[j];
|
||||
if (FD_ISSET(sn->fd, &sn_vec[i].select_fds))
|
||||
for (int type = 0; type < 3; type++) {
|
||||
foreach (QSockNot *sn, sn_vec[type].list) {
|
||||
if (FD_ISSET(sn->fd, &sn_vec[type].select_fds))
|
||||
q->setSocketNotifierPending(sn->obj);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue