From d2dbc12ee8540aeb80d6e914617bfe99c14d2ce1 Mon Sep 17 00:00:00 2001 From: Dariusz Komosinski Date: Tue, 8 Oct 2019 00:49:23 +0200 Subject: [PATCH] Final review fixes. --- src/Avalonia.Base/AvaloniaObject.cs | 36 +++++++++++------------------ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/src/Avalonia.Base/AvaloniaObject.cs b/src/Avalonia.Base/AvaloniaObject.cs index 1d49401d99..2450f1a3a1 100644 --- a/src/Avalonia.Base/AvaloniaObject.cs +++ b/src/Avalonia.Base/AvaloniaObject.cs @@ -333,17 +333,12 @@ namespace Avalonia throw new ArgumentException($"The property {property.Name} is readonly."); } - if (Logger.TryGet(LogEventLevel.Verbose, out var logger)) - { - var description = GetDescription(source); - - logger.Log( - LogArea.Property, - this, - "Bound {Property} to {Binding} with priority LocalValue", - property, - description); - } + Logger.TryGet(LogEventLevel.Verbose)?.Log( + LogArea.Property, + this, + "Bound {Property} to {Binding} with priority LocalValue", + property, + GetDescription(source)); if (_directBindings == null) { @@ -354,18 +349,13 @@ namespace Avalonia } else { - if (Logger.TryGet(LogEventLevel.Verbose, out var logger)) - { - var description = GetDescription(source); - - logger.Log( - LogArea.Property, - this, - "Bound {Property} to {Binding} with priority {Priority}", - property, - description, - priority); - } + Logger.TryGet(LogEventLevel.Verbose)?.Log( + LogArea.Property, + this, + "Bound {Property} to {Binding} with priority {Priority}", + property, + GetDescription(source), + priority); return Values.AddBinding(property, source, priority); }