From 5b51f2a0fa84c2787e556bff7035291fc8d891b0 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Fri, 15 Dec 2017 19:27:27 +0000 Subject: [PATCH] Avoid format strings in some places. Where it is possible to directly concat strings, prefer this in some often-called methods. --- OpenRA.Game/Support/PerfTimer.cs | 2 +- OpenRA.Game/World.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Support/PerfTimer.cs b/OpenRA.Game/Support/PerfTimer.cs index 21e7336b8c..65f6b39919 100644 --- a/OpenRA.Game/Support/PerfTimer.cs +++ b/OpenRA.Game/Support/PerfTimer.cs @@ -82,7 +82,7 @@ namespace OpenRA.Support var label = type == typeof(string) || type.IsGenericType ? item.ToString() : type.Name; Log.Write("perf", FormatString, 1000f * (endStopwatchTicks - startStopwatchTicks) / Stopwatch.Frequency, - "[{0}] {1}: {2}".F(Game.LocalTick, name, label)); + "[" + Game.LocalTick + "] " + name + ": " + label); } public static long LongTickThresholdInStopwatchTicks diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index 1d1688245f..d09a04de98 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -475,6 +475,6 @@ namespace OpenRA public bool Equals(TraitPair other) { return this == other; } public override bool Equals(object obj) { return obj is TraitPair && Equals((TraitPair)obj); } - public override string ToString() { return "{0}->{1}".F(Actor.Info.Name, Trait.GetType().Name); } + public override string ToString() { return Actor.Info.Name + "->" + Trait.GetType().Name; } } }