Remove some unneeded PerfSamples.

This commit is contained in:
RoosterDragon
2015-12-23 20:19:22 +00:00
parent 387d0d0e3f
commit 6d02d5ebaa
2 changed files with 4 additions and 14 deletions

View File

@@ -14,7 +14,6 @@ using System.IO;
using System.Net.Sockets; using System.Net.Sockets;
using System.Threading; using System.Threading;
using OpenRA.Server; using OpenRA.Server;
using OpenRA.Support;
namespace OpenRA.Network namespace OpenRA.Network
{ {
@@ -212,12 +211,6 @@ namespace OpenRA.Network
if (socket != null) if (socket != null)
socket.Client.Close(); socket.Client.Close();
using (new PerfSample("Thread.Join"))
{
if (!t.Join(1000))
return;
}
base.Dispose(disposing); base.Dispose(disposing);
} }

View File

@@ -32,13 +32,10 @@ namespace OpenRA
public static IEnumerable<Actor> FindActorsInCircle(this World world, WPos origin, WDist r) public static IEnumerable<Actor> FindActorsInCircle(this World world, WPos origin, WDist r)
{ {
using (new PerfSample("FindUnitsInCircle")) // Target ranges are calculated in 2D, so ignore height differences
{ var vec = new WVec(r, r, WDist.Zero);
// Target ranges are calculated in 2D, so ignore height differences return world.ActorMap.ActorsInBox(origin - vec, origin + vec).Where(
var vec = new WVec(r, r, WDist.Zero); a => (a.CenterPosition - origin).HorizontalLengthSquared <= r.LengthSquared);
return world.ActorMap.ActorsInBox(origin - vec, origin + vec).Where(
a => (a.CenterPosition - origin).HorizontalLengthSquared <= r.LengthSquared);
}
} }
public static void DoTimed<T>(this IEnumerable<T> e, Action<T> a, string text) public static void DoTimed<T>(this IEnumerable<T> e, Action<T> a, string text)