refactor: Simplify ScriptsHttpRequests.GetNextCompletedRequest to more simply iterate through pending requests without unnecessary checks.

user_profiles
Justin Clark-Casey (justincc) 2013-04-04 00:49:07 +01:00
parent 831e4c3850
commit f281a994e8
1 changed files with 4 additions and 10 deletions

View File

@ -293,19 +293,13 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
{ {
lock (HttpListLock) lock (HttpListLock)
{ {
foreach (UUID luid in m_pendingRequests.Keys) foreach (HttpRequestClass req in m_pendingRequests.Values)
{ {
HttpRequestClass tmpReq; if (req.Finished)
return req;
}
}
if (m_pendingRequests.TryGetValue(luid, out tmpReq))
{
if (tmpReq.Finished)
{
return tmpReq;
}
}
}
}
return null; return null;
} }