From 6c7ec7f91a9de238b2cfa563da4a54cfb8cb85be Mon Sep 17 00:00:00 2001 From: AdmAlexus Date: Sun, 29 Oct 2017 19:45:52 +0500 Subject: [PATCH] Fix V3029 warnings from PVS-Studio Static Analyzer Warnings with low priority: V3029 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 69, 71. TLPasswordInputSettings.cs 69 V3029 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 71, 73. TLPasswordInputSettings.cs 71 V3029 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 91, 93. TLPaymentForm.cs 91 V3029 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 120, 122. TLBotInlineResult.cs 120 V3029 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 124, 126. TLBotInlineResult.cs 124 V3029 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 124, 126. TLChannelFull.cs 124 V3029 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 120, 122. TLInputBotInlineResult.cs 120 V3029 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 124, 126. TLInputBotInlineResult.cs 124 V3029 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 154, 156. TLWebPage.cs 154 V3029 The conditional expressions of the 'if' statements situated alongside each other are identical. Check lines: 158, 160. TLWebPage.cs 158 --- TeleSharp.TL/TL/Account/TLPasswordInputSettings.cs | 4 ++-- TeleSharp.TL/TL/Payments/TLPaymentForm.cs | 3 ++- TeleSharp.TL/TL/TLBotInlineResult.cs | 6 ++++-- TeleSharp.TL/TL/TLChannelFull.cs | 3 ++- TeleSharp.TL/TL/TLInputBotInlineResult.cs | 6 ++++-- TeleSharp.TL/TL/TLWebPage.cs | 6 ++++-- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/TeleSharp.TL/TL/Account/TLPasswordInputSettings.cs b/TeleSharp.TL/TL/Account/TLPasswordInputSettings.cs index 646b2de..cf8995a 100644 --- a/TeleSharp.TL/TL/Account/TLPasswordInputSettings.cs +++ b/TeleSharp.TL/TL/Account/TLPasswordInputSettings.cs @@ -67,11 +67,11 @@ namespace TeleSharp.TL.Account ComputeFlags(); bw.Write(flags); if ((flags & 1) != 0) + { BytesUtil.Serialize(new_salt, bw); - if ((flags & 1) != 0) BytesUtil.Serialize(new_password_hash, bw); - if ((flags & 1) != 0) StringUtil.Serialize(hint, bw); + } if ((flags & 2) != 0) StringUtil.Serialize(email, bw); diff --git a/TeleSharp.TL/TL/Payments/TLPaymentForm.cs b/TeleSharp.TL/TL/Payments/TLPaymentForm.cs index ac674ba..7899a65 100644 --- a/TeleSharp.TL/TL/Payments/TLPaymentForm.cs +++ b/TeleSharp.TL/TL/Payments/TLPaymentForm.cs @@ -89,9 +89,10 @@ namespace TeleSharp.TL.Payments bw.Write(provider_id); StringUtil.Serialize(url, bw); if ((flags & 16) != 0) + { StringUtil.Serialize(native_provider, bw); - if ((flags & 16) != 0) ObjectUtils.SerializeObject(native_params, bw); + } if ((flags & 1) != 0) ObjectUtils.SerializeObject(saved_info, bw); if ((flags & 2) != 0) diff --git a/TeleSharp.TL/TL/TLBotInlineResult.cs b/TeleSharp.TL/TL/TLBotInlineResult.cs index a755165..d2cd584 100644 --- a/TeleSharp.TL/TL/TLBotInlineResult.cs +++ b/TeleSharp.TL/TL/TLBotInlineResult.cs @@ -118,13 +118,15 @@ namespace TeleSharp.TL if ((flags & 16) != 0) StringUtil.Serialize(thumb_url, bw); if ((flags & 32) != 0) + { StringUtil.Serialize(content_url, bw); - if ((flags & 32) != 0) StringUtil.Serialize(content_type, bw); + } if ((flags & 64) != 0) + { bw.Write(w.Value); - if ((flags & 64) != 0) bw.Write(h.Value); + } if ((flags & 128) != 0) bw.Write(duration.Value); ObjectUtils.SerializeObject(send_message, bw); diff --git a/TeleSharp.TL/TL/TLChannelFull.cs b/TeleSharp.TL/TL/TLChannelFull.cs index 9103d6f..70832ef 100644 --- a/TeleSharp.TL/TL/TLChannelFull.cs +++ b/TeleSharp.TL/TL/TLChannelFull.cs @@ -122,9 +122,10 @@ namespace TeleSharp.TL ObjectUtils.SerializeObject(exported_invite, bw); ObjectUtils.SerializeObject(bot_info, bw); if ((flags & 16) != 0) + { bw.Write(migrated_from_chat_id.Value); - if ((flags & 16) != 0) bw.Write(migrated_from_max_id.Value); + } if ((flags & 32) != 0) bw.Write(pinned_msg_id.Value); diff --git a/TeleSharp.TL/TL/TLInputBotInlineResult.cs b/TeleSharp.TL/TL/TLInputBotInlineResult.cs index 61cb634..83d6404 100644 --- a/TeleSharp.TL/TL/TLInputBotInlineResult.cs +++ b/TeleSharp.TL/TL/TLInputBotInlineResult.cs @@ -118,13 +118,15 @@ namespace TeleSharp.TL if ((flags & 16) != 0) StringUtil.Serialize(thumb_url, bw); if ((flags & 32) != 0) + { StringUtil.Serialize(content_url, bw); - if ((flags & 32) != 0) StringUtil.Serialize(content_type, bw); + } if ((flags & 64) != 0) + { bw.Write(w.Value); - if ((flags & 64) != 0) bw.Write(h.Value); + } if ((flags & 128) != 0) bw.Write(duration.Value); ObjectUtils.SerializeObject(send_message, bw); diff --git a/TeleSharp.TL/TL/TLWebPage.cs b/TeleSharp.TL/TL/TLWebPage.cs index 695ea72..b38d1a8 100644 --- a/TeleSharp.TL/TL/TLWebPage.cs +++ b/TeleSharp.TL/TL/TLWebPage.cs @@ -152,13 +152,15 @@ namespace TeleSharp.TL if ((flags & 16) != 0) ObjectUtils.SerializeObject(photo, bw); if ((flags & 32) != 0) + { StringUtil.Serialize(embed_url, bw); - if ((flags & 32) != 0) StringUtil.Serialize(embed_type, bw); + } if ((flags & 64) != 0) + { bw.Write(embed_width.Value); - if ((flags & 64) != 0) bw.Write(embed_height.Value); + } if ((flags & 128) != 0) bw.Write(duration.Value); if ((flags & 256) != 0)