소스 검색

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);