Преглед на файлове

Make the logic positive

This is a fun trick. Saying `is true` covers the null check because the left operand must be something that evaluates to a boolean with a value of `true`.
Brandon Thetford преди 1 година
родител
ревизия
3f3264229f
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      Terminal.Gui/Application.cs

+ 1 - 1
Terminal.Gui/Application.cs

@@ -1601,7 +1601,7 @@ public static partial class Application
 
         bool AdornmentHandledMouseEvent (Adornment? frame)
         {
-            if (frame?.Thickness.Contains (frame.FrameToScreen (), a.MouseEvent.X, a.MouseEvent.Y) ?? false)
+            if (frame?.Thickness.Contains (frame.FrameToScreen (), a.MouseEvent.X, a.MouseEvent.Y) is true)
             {
                 Point boundsPoint = frame.ScreenToBounds (a.MouseEvent.X, a.MouseEvent.Y);