FreeAndNil commented on code in PR #126:
URL: https://github.com/apache/logging-log4net/pull/126#discussion_r1529138434


##########
src/log4net/Core/LoggingEvent.cs:
##########
@@ -826,11 +825,10 @@ private static string TryReadWindowsIdentityUserName()
         {
           try
           {
-            if (System.Threading.Thread.CurrentPrincipal is not null &&
-                System.Threading.Thread.CurrentPrincipal.Identity is not null 
&&
-                System.Threading.Thread.CurrentPrincipal.Identity.Name is not 
null)
+            if (Thread.CurrentPrincipal is not null &&

Review Comment:
   I think we can shorten this even more:
   ```suggestion
               if (Thread.CurrentPrincipal?.Identity?.Name is string name)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to