Provide an early exit in RunActivity when there is no activity.
This commit is contained in:
@@ -74,6 +74,9 @@ namespace OpenRA.Traits
|
|||||||
|
|
||||||
public static Activity RunActivity(Actor self, Activity act)
|
public static Activity RunActivity(Actor self, Activity act)
|
||||||
{
|
{
|
||||||
|
if (act == null)
|
||||||
|
return act;
|
||||||
|
|
||||||
// Note - manual iteration here for performance due to high call volume.
|
// Note - manual iteration here for performance due to high call volume.
|
||||||
var longTickThresholdInStopwatchTicks = PerfTimer.LongTickThresholdInStopwatchTicks;
|
var longTickThresholdInStopwatchTicks = PerfTimer.LongTickThresholdInStopwatchTicks;
|
||||||
var start = Stopwatch.GetTimestamp();
|
var start = Stopwatch.GetTimestamp();
|
||||||
|
|||||||
Reference in New Issue
Block a user