提交 6c7960d8 编写于 作者: D Dustin Campbell

Code review feedback to use null conditional operator

上级 5f140f32
......@@ -28,7 +28,7 @@ public override void Write(object o)
{
if (Debugger.IsLogging())
{
Debugger.Log(0, null, o != null ? o.ToString() : null);
Debugger.Log(0, null, o?.ToString());
}
}
......@@ -36,7 +36,7 @@ public override void Write(object o, string category)
{
if (Debugger.IsLogging())
{
Debugger.Log(0, category, o != null ? o.ToString() : null);
Debugger.Log(0, category, o?.ToString());
}
}
......@@ -60,7 +60,7 @@ public override void WriteLine(object o)
{
if (Debugger.IsLogging())
{
Debugger.Log(0, null, (o != null ? o.ToString() : null) + Environment.NewLine);
Debugger.Log(0, null, o?.ToString() + Environment.NewLine);
}
}
......@@ -68,7 +68,7 @@ public override void WriteLine(object o, string category)
{
if (Debugger.IsLogging())
{
Debugger.Log(0, category, (o != null ? o.ToString() : null) + Environment.NewLine);
Debugger.Log(0, category, o?.ToString() + Environment.NewLine);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册