Minor update: code compacting
This commit is contained in:
@@ -89,9 +89,9 @@ void CSelect::Add( int FD, bool Read, bool Write, THandle * Handle, CSelectableB
|
||||
|
||||
// Check if SelectHandle already exists
|
||||
SelectHandle = &FirstHandle;
|
||||
while (*SelectHandle && ((*SelectHandle)->FD != FD)) {
|
||||
while (*SelectHandle && ((*SelectHandle)->FD != FD))
|
||||
SelectHandle = &((*SelectHandle)->Next);
|
||||
}
|
||||
|
||||
if (!*SelectHandle) {
|
||||
// Create if not exist
|
||||
*SelectHandle = new TSelectHandle;
|
||||
@@ -151,9 +151,9 @@ void CSelect::Remove( int FD, bool Read, bool Write )
|
||||
|
||||
// Check if SelectHandle already exists
|
||||
SelectHandle = &FirstHandle;
|
||||
while (*SelectHandle && ((*SelectHandle)->FD != FD)) {
|
||||
while (*SelectHandle && ((*SelectHandle)->FD != FD))
|
||||
SelectHandle = &((*SelectHandle)->Next);
|
||||
}
|
||||
|
||||
// Check if found
|
||||
if (!*SelectHandle)
|
||||
return;
|
||||
@@ -210,9 +210,8 @@ bool CSelect::Test()
|
||||
// Update Maximum Test FD
|
||||
if (Handle->FD == MaxFD-1) {
|
||||
for (TestFD = MaxFD-1; TestFD >= 0; TestFD--) {
|
||||
if (FD_ISSET( TestFD, &ReadTestFDS ) || FD_ISSET( TestFD, &WriteTestFDS )) {
|
||||
if (FD_ISSET( TestFD, &ReadTestFDS ) || FD_ISSET( TestFD, &WriteTestFDS ))
|
||||
break;
|
||||
}
|
||||
}
|
||||
MaxFD = TestFD+1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user