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;
|
timeval tm;
|
||||||
tm.tv_sec = tm.tv_usec = 0l;
|
tm.tv_sec = tm.tv_usec = 0l;
|
||||||
|
|
||||||
for (int type = 0; type < 3; ++type) {
|
for (int type = 0; type < 3; type++) {
|
||||||
QSockNotType::List &list = sn_vec[type].list;
|
foreach (QSockNot *sn, sn_vec[type].list) {
|
||||||
if (list.size() == 0)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
for (int i = 0; i < list.size(); ++i) {
|
|
||||||
QSockNot *sn = list[i];
|
|
||||||
|
|
||||||
FD_ZERO(&fdset);
|
FD_ZERO(&fdset);
|
||||||
FD_SET(sn->fd, &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 (! (flags & QEventLoop::ExcludeSocketNotifiers) && nsel > 0 && sn_highest >= 0) {
|
||||||
// if select says data is ready on any socket, then set the socket notifier
|
// if select says data is ready on any socket, then set the socket notifier
|
||||||
// to pending
|
// to pending
|
||||||
for (int i=0; i<3; i++) {
|
for (int type = 0; type < 3; type++) {
|
||||||
QSockNotType::List &list = sn_vec[i].list;
|
foreach (QSockNot *sn, sn_vec[type].list) {
|
||||||
for (int j = 0; j < list.size(); ++j) {
|
if (FD_ISSET(sn->fd, &sn_vec[type].select_fds))
|
||||||
QSockNot *sn = list[j];
|
|
||||||
if (FD_ISSET(sn->fd, &sn_vec[i].select_fds))
|
|
||||||
q->setSocketNotifierPending(sn->obj);
|
q->setSocketNotifierPending(sn->obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue