Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

Commit 4872d24

Browse files
committed
new Exception().StackTrace is better than new StackTrace()...
1 parent 1916cfb commit 4872d24

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Runtime/scheduler/ticker.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public interface TickerProvider {
1616
public class Ticker {
1717
public Ticker(TickerCallback onTick, string debugLabel = null) {
1818
D.assert(() => {
19-
this._debugCreationStack = new StackTrace();
19+
this._debugCreationStack = new Exception().StackTrace;
2020
return true;
2121
});
2222
this._onTick = onTick;
@@ -195,7 +195,7 @@ public virtual void dispose() {
195195

196196
public readonly string debugLabel;
197197

198-
StackTrace _debugCreationStack;
198+
string _debugCreationStack;
199199

200200
public override string ToString() {
201201
return this.toString(debugIncludeStack: false);
@@ -213,7 +213,7 @@ public string toString(bool debugIncludeStack = false) {
213213
if (debugIncludeStack) {
214214
buffer.AppendLine();
215215
buffer.AppendLine("The stack trace when the " + this.GetType() + " was actually created was:");
216-
UIWidgetsError.defaultStackFilter(this._debugCreationStack.ToString().TrimEnd().Split('\n'))
216+
UIWidgetsError.defaultStackFilter(this._debugCreationStack.TrimEnd().Split('\n'))
217217
.Each(line => buffer.AppendLine(line));
218218
}
219219

0 commit comments

Comments
 (0)