refactor: Simplify ScriptsHttpRequests.GetNextCompletedRequest to more simply iterate through pending requests without unnecessary checks.
parent
831e4c3850
commit
f281a994e8
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue