From d7d3ce4fc18607cc7e472b0bb7929dac010f8d16 Mon Sep 17 00:00:00 2001 From: Ivan Bidolakh Date: Sun, 29 Apr 2018 01:54:42 +0300 Subject: [PATCH] Remove unnecessary null check Split function always return array. If you look at the source of it, it even guarantees it with code contracts --- ShareX.HelpersLib/Extensions/XMLExtensions.cs | 2 +- ShareX.UploadersLib/FileUploaders/Puush.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ShareX.HelpersLib/Extensions/XMLExtensions.cs b/ShareX.HelpersLib/Extensions/XMLExtensions.cs index 1b7fadb46..e48d21bfb 100644 --- a/ShareX.HelpersLib/Extensions/XMLExtensions.cs +++ b/ShareX.HelpersLib/Extensions/XMLExtensions.cs @@ -41,7 +41,7 @@ public static XElement GetNode(this XContainer element, string path) string[] splitPath = path.Split('/'); - if (splitPath != null && splitPath.Length > 0) + if (splitPath.Length > 0) { foreach (string name in splitPath) { diff --git a/ShareX.UploadersLib/FileUploaders/Puush.cs b/ShareX.UploadersLib/FileUploaders/Puush.cs index 2829e1025..f0709da48 100644 --- a/ShareX.UploadersLib/FileUploaders/Puush.cs +++ b/ShareX.UploadersLib/FileUploaders/Puush.cs @@ -90,7 +90,7 @@ public string Login(string email, string password) { string[] values = response.Split(','); - if (values != null && values.Length > 1) + if (values.Length > 1) { int status; @@ -119,7 +119,7 @@ public bool DeleteFile(string id) { string[] lines = response.Lines(); - if (lines != null && lines.Length > 0) + if (lines.Length > 0) { int status; @@ -144,7 +144,7 @@ public override UploadResult Upload(Stream stream, string fileName) { string[] values = result.Response.Split(','); - if (values != null && values.Length > 0) + if (values.Length > 0) { int status;