From aa1e8afe4378f7f77d2560d464003b74f88b0488 Mon Sep 17 00:00:00 2001 From: Ivan Bidolakh Date: Sun, 29 Apr 2018 01:38:21 +0300 Subject: [PATCH] Cleanup code newPoints is array of structs "System.Drawing.Point". Any element of an array can not be null. That expression (newPoints[i] == null) always return false. So, we can remove this cycle without changes in program logic. --- ShareX.ScreenCaptureLib/Shapes/Drawing/LineDrawingShape.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ShareX.ScreenCaptureLib/Shapes/Drawing/LineDrawingShape.cs b/ShareX.ScreenCaptureLib/Shapes/Drawing/LineDrawingShape.cs index 9b732c240..8828b22a3 100644 --- a/ShareX.ScreenCaptureLib/Shapes/Drawing/LineDrawingShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/Drawing/LineDrawingShape.cs @@ -51,11 +51,6 @@ private void AdjustPoints(int centerPointCount) newPoints[newPoints.Length - 1] = Points[Points.Length - 1]; } - for (int i = 0; i < newPoints.Length; i++) - { - if (newPoints[i] == null) newPoints[i] = new Point(); - } - Points = newPoints; }