fixing unnecessary allocations when debug mode disabled

This commit is contained in:
Soraphis 2022-02-23 16:59:42 +01:00 committed by Miika Lönnqvist
parent aecaa73ad0
commit 9837fff97f

View File

@ -60,9 +60,9 @@ namespace UnityAtoms
}
}
public static StackTraceEntry Create(object obj, int skipFrames = 0) => new StackTraceEntry(new StackTrace(skipFrames), obj);
public static StackTraceEntry Create(object obj, int skipFrames = 0) => AtomPreferences.IsDebugModeEnabled ? new StackTraceEntry(new StackTrace(skipFrames), obj) : null;
public static StackTraceEntry Create(int skipFrames = 0) => new StackTraceEntry(new StackTrace(skipFrames));
public static StackTraceEntry Create(int skipFrames = 0) => AtomPreferences.IsDebugModeEnabled ? new StackTraceEntry(new StackTrace(skipFrames)) : null;
public override bool Equals(object obj) => Equals(obj as StackTraceEntry);