{"id":363617,"date":"2024-05-21T01:59:55","date_gmt":"2024-05-21T01:59:55","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=363617"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T01:59:55","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=363617","title":{"rendered":"<span>\u0422\u043e\u043f-10 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0432 C#-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0437\u0430 2023 \u0433\u043e\u0434<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0417\u0430 2023 \u0433\u043e\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 PVS-Studio \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0435\u043c\u0430\u043b\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 Open Source C#-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041f\u043e \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0438 \u043c\u044b \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 10-\u044e \u0441\u0430\u043c\u044b\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u0430 \u044d\u0442\u043e\u0442 \u0433\u043e\u0434. \u041f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f!<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4fe\/b98\/264\/4feb98264bb48cd2af629c144fe4c99c.png\" alt=\"1094_CSharpTop_2023_ru\/image1.png\" title=\"\" width=\"1600\" height=\"902\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4fe\/b98\/264\/4feb98264bb48cd2af629c144fe4c99c.png\"\/><\/figure>\n<h3>\u041a\u0430\u043a \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0442\u043e\u043f?<\/h3>\n<p>\u0414\u043b\u044f \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u0442\u043e\u043f \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c:<\/p>\n<ul>\n<li>\n<p>\u0431\u044b\u0442\u044c \u043a\u043e\u0434\u043e\u043c \u0438\u0437 Open Source \u043f\u0440\u043e\u0435\u043a\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio;<\/p>\n<\/li>\n<li>\n<p>\u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u043e\u0448\u0438\u0431\u043a\u0443;<\/p>\n<\/li>\n<li>\n<p>\u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432 \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0442\u044c 10 \u043b\u0443\u0447\u0448\u0438\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. \u0414\u0430, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u043e \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u044f\u043c \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0442\u043e\u043f-10.<\/p>\n<p>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0438 C# \u0431\u0430\u0433\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1020\/\">\u0442\u043e\u043f-10 \u043e\u0448\u0438\u0431\u043e\u043a \u0437\u0430 2022 \u0433\u043e\u0434<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/0904\/\">\u0442\u043e\u043f-10 \u043e\u0448\u0438\u0431\u043e\u043a \u0437\u0430 2021 \u0433\u043e\u0434<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/0787\/\">\u0442\u043e\u043f-10 \u043e\u0448\u0438\u0431\u043e\u043a \u0437\u0430 2020 \u0433\u043e\u0434<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/0698\/\">\u0442\u043e\u043f-10 \u043e\u0448\u0438\u0431\u043e\u043a \u0437\u0430 2019 \u0433\u043e\u0434<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u0442\u043e\u043c\u0438\u0442\u044c, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0443 \u043d\u043e\u0432\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439!<\/p>\n<p>P.S. \u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0432 \u0442\u043e\u043f\u0435. \u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043c\u043d\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u0440\u0430.<\/p>\n<h3>10 \u043c\u0435\u0441\u0442\u043e. \u041d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 NullReferenceException<\/h3>\n<p>\u041d\u0430\u0448 \u0442\u043e\u043f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1032\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 MudBlazor<\/a>:<\/p>\n<pre><code class=\"cs\">public static bool operator ==(ResizeOptions l, ResizeOptions r)                                                         => l.Equals(r);  public static bool operator !=(ResizeOptions l, ResizeOptions r)                                                         => !l.Equals(r); <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3115\/\">V3115<\/a> Passing &#8216;null&#8217; to &#8216;==&#8217; operator should not result in &#8216;NullReferenceException&#8217;. ResizeOptions.cs 34<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3115\/\">V3115<\/a> Passing &#8216;null&#8217; to &#8216;!=&#8217; operator should not result in &#8216;NullReferenceException&#8217;. ResizeOptions.cs 35<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 &#8216;==&#8217; \u0438 &#8216;!=&#8217; \u043b\u0435\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>null<\/em>. \u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <em>l<\/em> \u2013 <em>null<\/em>, \u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Equals<\/em> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <em>NullReferenceException<\/em>. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Equals<\/em>, \u043a\u0441\u0442\u0430\u0442\u0438, \u0442\u0430\u043a \u0436\u0435 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:<\/p>\n<pre><code class=\"cs\">public bool Equals(ResizeOptions other) {   if (ReportRate != other.ReportRate || ....)     \/\/ &lt;=   {     return false;   }   .... } <\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c \u0441\u044e\u0440\u043f\u0440\u0438\u0437\u043e\u043c \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0435\u0441\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>ResizeOptions<\/em>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 <em>ResizeOptions<\/em> \u0441 <em>null<\/em>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/4b8\/08e\/0af\/4b808e0afd828489784447a11c8d972d.png\" alt=\"1094_CSharpTop_2023_ru\/image2.png\" title=\"\" width=\"706\" height=\"286\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4b8\/08e\/0af\/4b808e0afd828489784447a11c8d972d.png\"\/><\/figure>\n<p>\u0412\u043f\u043e\u043b\u043d\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <em>NullReferenceException<\/em>. \u0415\u0441\u043b\u0438 \u043f\u0440\u0430\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u2014 <em>null<\/em>, \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c83\/911\/acc\/c83911accd36ca029a3c3c69d030b485.png\" alt=\"1094_CSharpTop_2023_ru\/image3.png\" title=\"\" width=\"703\" height=\"287\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c83\/911\/acc\/c83911accd36ca029a3c3c69d030b485.png\"\/><\/figure>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438 \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0432 <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/csharp\/programming-guide\/statements-expressions-operators\/how-to-define-value-equality-for-a-type\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Microsoft<\/a>.<\/p>\n<h3>9 \u043c\u0435\u0441\u0442\u043e. \u041f\u0435\u0440\u0435\u0434\u0432\u0438\u043d\u0443\u043b\u0438<\/h3>\n<p>\u041d\u0430 9-\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1078\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Microsoft PowerToys<\/a>:<\/p>\n<pre><code class=\"cs\">public static List&lt;PluginPair> AllPlugins {   get   {     ....     try     {       \/\/ Return a comparable produce version.       var fileVersion = FileVersionInfo.GetVersionInfo(x.ExecuteFilePath);       return ((uint)fileVersion.ProductMajorPart &lt;&lt; 48)       | ((uint)fileVersion.ProductMinorPart &lt;&lt; 32)       | ((uint)fileVersion.ProductBuildPart &lt;&lt; 16)       | ((uint)fileVersion.ProductPrivatePart);       }     catch (System.IO.FileNotFoundException)     {       return 0U;     }     ....   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3134\/\">V3134<\/a> Shift by 48 bits is greater than the size of &#8216;UInt32&#8217; type of expression &#8216;(uint)fileVersion.ProductMajorPart&#8217;. PluginManager.cs 62<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3134\/\">V3134<\/a> Shift by 32 bits is greater than the size of &#8216;UInt32&#8217; type of expression &#8216;(uint)fileVersion.ProductMinorPart&#8217;. PluginManager.cs 63<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0439\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430 \u0442\u0438\u043f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u043d\u0430 \u0442\u0438\u043f \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041a\u043e\u0434 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043e\u0442\u0440\u044b\u0432\u043e\u043a \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043b\u044f\u043c\u0431\u0434\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u043d\u0430 \u043d\u0435\u0433\u043e \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f. \u0422\u0438\u043f <em>uint<\/em> \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 32 \u0431\u0438\u0442\u0430. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0434\u0432\u0438\u0433 \u043d\u0430 48 \u0431\u0438\u0442 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0441\u0434\u0432\u0438\u0433\u0443 \u043d\u0430 16. \u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u0434\u0432\u0438\u0433 \u043d\u0430 32 \u0431\u0438\u0442\u0430 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0441\u0434\u0432\u0438\u0433\u0443 \u043d\u0430 0 \u0431\u0438\u0442.<\/p>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u041d\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u043c\u0435\u0441\u0442\u043e <em>uint<\/em> \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <em>ulong<\/em>.<\/p>\n<h3>8 \u043c\u0435\u0441\u0442\u043e. \u0421\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432<\/h3>\n<p>\u041d\u0430 8-\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 \u0440\u0430\u043d\u0435\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0439 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1032\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e MudBlazor<\/a>:<\/p>\n<pre><code class=\"cs\">internal void DateValueChanged(DateTime? value) {   _valueDate = value;    if (value != null)   {     var date = value.Value.Date;      \/\/ get the time component and add it to the date.     if (_valueTime != null)     {       date.Add(_valueTime.Value);                    \/\/ &lt;=     }      _filterDefinition.Value = date;   }   else     _filterDefinition.Value = value;    _dataGrid.GroupItems(); } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3010\/\">V3010<\/a> The return value of function &#8216;Add&#8217; is required to be utilized. Filter.cs 140<\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Add<\/em> \u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u0438\u043f\u0430 <em>DateTime<\/em> \u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0445\u043e\u0442\u0435\u043b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>_valueTime.Value<\/em> \u043a <em>date<\/em>. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u043d \u043d\u0435 \u0443\u0447\u0451\u043b, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <em>Add<\/em> \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 <em>DateTime<\/em> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0430 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0438\u043c\u0435\u0435\u043c \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0437\u0430\u0434\u0443\u043c\u043a\u0435 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u043d\u0430 \u0447\u0442\u043e-\u0442\u043e \u0432\u043b\u0438\u044f\u0442\u044c.<\/p>\n<h3>7 \u043c\u0435\u0441\u0442\u043e. \u041f\u043e\u0431\u0438\u0442\u043e\u0432\u0430\u044f \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0430<\/h3>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0432\u0437\u044f\u0442\u043e \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1059\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 Ryujinx<\/a>:<\/p>\n<pre><code class=\"cs\">private void YesButton_Clicked(object sender, EventArgs args) {   ....   Window.Functions = _mainWindow.Window.Functions =     WMFunction.All &amp; WMFunction.Close;   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3182\/\">V3182<\/a> The result of &#8216;WMFunction.All &amp; WMFunction.Close&#8217; expression is &#8216;0&#8217;. It is possible that the &#8216;|&#8217; operator should be used instead. UpdateDialog.cs 69<\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;&amp;&#8217;. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u0443, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 <em>WMFunction<\/em>:<\/p>\n<pre><code class=\"cs\">[Flags] public enum WMFunction {   All = 0x1,   Resize = 0x2,   Move = 0x4,   Minimize = 0x8,   Maximize = 0x10,   Close = 0x20 } <\/code><\/pre>\n<p>\u041c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u0444\u043b\u0430\u0433\u0430\u043c\u0438, \u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c: \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0418 (&amp;) \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <em>WMFunction.All<\/em> \u0438 <em>WMFunction.Close<\/em> \u0431\u0443\u0434\u0435\u0442 \u043d\u043e\u043b\u044c.<\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c &#8216;&amp;&#8217; \u043d\u0430 &#8216;|&#8217;.<\/p>\n<h3>6 \u043c\u0435\u0441\u0442\u043e. \u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 String.Format<\/h3>\n<p>\u0414\u0432\u0438\u0436\u0435\u043c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435. \u0421\u0435\u0439\u0447\u0430\u0441 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u043d\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1057\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 AWS SDK \u0434\u043b\u044f .NET<\/a>:<\/p>\n<pre><code class=\"cs\">private static string GetXamarinInformation() {   var xamarinDevice = Type.GetType(\"Xamarin.Forms.Device, Xamarin.Forms.Core\");   if (xamarinDevice == null)   {     return null;   }    var runtime = xamarinDevice.GetProperty(\"RuntimePlatform\")                             ?.GetValue(null)                             ?.ToString() ?? \"\";    var idiom = xamarinDevice.GetProperty(\"Idiom\")                           ?.GetValue(null)                           ?.ToString() ?? \"\";    var platform = runtime + idiom;    if (string.IsNullOrEmpty(platform))   {     platform = UnknownPlatform;   }    return string.Format(CultureInfo.InvariantCulture, \"Xamarin_{0}\", \"Xamarin\"); } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3137\/\">V3137<\/a> The &#8216;platform&#8217; variable is assigned but is not used by the end of the function. InternalSDKUtils.netstandard.cs 70<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u043e. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <em>String.Format<\/em> \u0432 \u0448\u0430\u0431\u043b\u043e\u043d <em>&#171;Xamarin_{0}&#187;<\/em> \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u043b <em>&#171;Xamarin&#187;.<\/em> \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>platform<\/em>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0442\u0440\u0430\u043d\u043d\u043e.<\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <em>return<\/em> \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">return string.Format(CultureInfo.InvariantCulture, \"Xamarin_{0}\", platform); <\/code><\/pre>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0440\u044f\u0434\u043e\u043c \u0435\u0441\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e Unity. \u041e\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043f\u043e \u0441\u0445\u043e\u0436\u0435\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443, \u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u0436\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e:<\/p>\n<pre><code class=\"cs\">private static string GetUnityInformation() {   var unityApplication      = Type.GetType(\"UnityEngine.Application, UnityEngine.CoreModule\");   if (unityApplication == null)   {     return null;   }    var platform = unityApplication.GetProperty(\"platform\")                                 ?.GetValue(null)                                 ?.ToString() ?? UnknownPlatform;    return string.Format(CultureInfo.InvariantCulture, \"Unity_{0}\", platform); } <\/code><\/pre>\n<h3>5 \u043c\u0435\u0441\u0442\u043e. \u0411\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u043c\u0435\u043d\u044c\u0448\u0435?<\/h3>\n<p>\u0412\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u0442\u043e\u043f\u0430 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1051\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 BTCPay Server<\/a>:<\/p>\n<pre><code class=\"cs\">private IActionResult Validate(StoreBaseData request) {   ....   if (request.PaymentTolerance &lt; 0 &amp;&amp; request.PaymentTolerance > 100)     ModelState.AddModelError(nameof(request.PaymentTolerance),       \"PaymentTolerance can only be between 0 and 100 percent\");   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;request.PaymentTolerance &lt; 0 &amp;&amp; request.PaymentTolerance > 100&#8217; is always false. Probably the &#8216;||&#8217; operator should be used here. BTCPayServer\\Controllers\\GreenField\\GreenfieldStoresController.cs 241<\/p>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0445\u043e\u0442\u044c \u0440\u0430\u0437 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u043e\u0442\u043c\u0435\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437-\u0437\u0430 \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430 \u0432 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. \u0418\u043d\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u0430\u0447\u043d\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0435\u0441\u0442\u044c \u0433\u043b\u0443\u043f\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430.<\/p>\n<p>\u0422\u0430\u043a, \u0432 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b &#8216;&amp;&amp;&#8217; \u0438 &#8216;||&#8217;. \u041a\u043e\u0434 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043e\u0442 0 \u0434\u043e 100, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u043d\u043e.<\/p>\n<p>\u041a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u043d\u0435\u0432\u0435\u0440\u043d\u043e \u0432\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442 \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e \u043a\u043e\u0434\u0443 \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043e\u0448\u0438\u0431\u043a\u0435 \u0432 \u043b\u043e\u0433\u0438\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h3>4 \u043c\u0435\u0441\u0442\u043e. \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b<\/h3>\n<p>\u041d\u0430 4-\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u0443\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0444\u0438\u043d\u0430\u043b\u0438\u0441\u0442\u0430\u043c. \u0415\u0433\u043e \u044f \u0432\u0437\u044f\u043b \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1032\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 MudBlazor<\/a>.<\/p>\n<pre><code class=\"cs\">internal async Task&lt;bool> StartResizeColumn(....) {   ....   \/\/ In case resize mode is column, we have to find any column right   \/\/ of the current one that can also be resized and is not hidden.    var nextResizableColumn = _columns.Skip(_....) + 1)                                     .FirstOrDefault(c =>                                         c.Resizable ?? true &amp;&amp; !c.Hidden); \/\/ &lt;=   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3177\/\">V3177<\/a> The &#8216;true&#8217; literal belongs to the &#8216;&amp;&amp;&#8217; operator with a higher priority. It is possible the literal was intended to belong to &#8216;??&#8217; operator instead. DataGridColumnResizeService.cs 52<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <em>c.Resizable ?? true &amp;&amp; !c.Hidden<\/em>. \u0421\u0442\u043e\u0438\u0442 \u0441\u0440\u0430\u0437\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0443 &#8216;??&#8217; \u043d\u0438\u0436\u0435, \u0447\u0435\u043c \u0443 &#8216;&amp;&amp;&#8217;. \u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u044d\u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 <em>c.Resizable<\/em> \u2014 <em>null<\/em>, \u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 null-coalescing \u0432\u0435\u0440\u043d\u0451\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <em>true &amp;&amp; !c.Hidden<\/em>. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f &#171;&amp;&amp;&#187; \u0441 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u043c <em>true<\/em> \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u0430. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">(c.Resizable ?? true) &amp;&amp; !c.Hidden <\/code><\/pre>\n<p>\u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u044d\u0442\u0438\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043f\u0440\u043e\u044f\u0432\u0438\u0442 \u0441\u0435\u0431\u044f, \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <em>c.Resizable<\/em> \u0438 <em>c.Hidden<\/em> \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0432\u043d\u044b <em>true<\/em>.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043c\u043e\u043c\u0435\u043d\u0442, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439, \u0447\u0442\u043e \u0431\u044b\u043b\u0430 \u0434\u043e\u043f\u0443\u0449\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430. \u0421\u0442\u0440\u043e\u0447\u043a\u043e\u0439 \u0432\u044b\u0448\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439, \u0447\u0442\u043e \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430 (\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u044d\u0442\u043e\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 <em>c.Resizable<\/em>) \u0438 \u043d\u0435 \u0431\u044b\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u044b\u043c (\u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0438\u0437 <em>c.Hidden<\/em>). \u0415\u0441\u043b\u0438 <em>c.Resizable<\/em> \u2014 <em>true<\/em>, \u0442\u043e \u043b\u043e\u0433\u0438\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>c.Hidden<\/em> \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<h3>3 \u043c\u0435\u0441\u0442\u043e. \u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u043c\u044b \u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0434\u043e \u0442\u0440\u043e\u0439\u043a\u0438 \u043b\u0438\u0434\u0435\u0440\u043e\u0432. \u0415\u0451 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u044f \u0432\u0437\u044f\u043b \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1056\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0440\u043e \u041e\u0431\u0437\u043e\u0440 Top-3 Open Source \u0438\u0433\u0440 \u043d\u0430 C#<\/a>. \u041f\u0440\u043e\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u044b\u043b\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u2014 Barotrauma. \u041e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0445\u043e\u0440\u043e\u0448\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u043c\u043e\u0449\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0433\u043b\u0430\u0437\u0430\u043c\u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043b\u0451\u0433\u043a\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439:<\/p>\n<pre><code class=\"cs\">public void RecreateSprites() {   ....   for (int i = 0; i &lt; DecorativeSprites.Count; i++)   {     var decorativeSprite = DecorativeSprites[i];     decorativeSprite.Remove();     var source = decorativeSprite.Sprite.SourceElement;     DecorativeSprites[i] = new DecorativeSprite(source, ....);             } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3080\/\">V3080<\/a>. Possible null dereference. Consider inspecting &#8216;decorativeSprite.Sprite&#8217;. Limb.cs 462.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u0432 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043d\u0435\u0438\u0437\u0431\u0435\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <em>NullReferenceException<\/em>. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u0430 <em>decorativeSprite.Remove<\/em>:<\/p>\n<pre><code class=\"cs\">partial class DeformableSprite {   ....   public Sprite Sprite { get; private set; }   ....    public void Remove()   {     Sprite?.Remove();     Sprite = null;     ....   } } <\/code><\/pre>\n<p>\u0412 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <em>Sprite<\/em> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>null<\/em>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0435\u0449\u0451 \u0440\u0430\u0437 \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u043c\u0435\u0442\u043e\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <em>Remove<\/em>, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a <em>decorativeSprite.Sprite.SourceElement<\/em> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. \u0422\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u043e \u0432\u044b\u0437\u043e\u0432\u043e\u043c <em>Remove<\/em> \u043f\u0435\u0440\u0435\u0434 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0437\u0434\u0435\u0441\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Remove<\/em> \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>source<\/em>.<\/p>\n<h3>2 \u043c\u0435\u0441\u0442\u043e. \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 NAN<\/h3>\n<p>\u0421 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0442\u0441\u0442\u0430\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0442 \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044f \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438 &#171;<a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1023\/\">PVS-Studio \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c Blazor \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b<\/a>&#171;. \u041a\u0441\u0442\u0430\u0442\u0438, \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0437\u0440\u044f \u0438\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 :). PVS-Studio \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c Blazor \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c Blazor \u043f\u0440\u043e\u0435\u043a\u0442, \u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/try-free\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1094\">\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c<\/a> \u043d\u0430 \u043d\u0451\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440.<\/p>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044e. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u0435\u0433\u043e \u043d\u0430 \u043a\u043e\u0434 \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 MudBlazor.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"cs\">@code {   ....   public void Evaluate()   {     ....     var exp = new Expression(CalcExpression);     var result = exp.Eval();     if (result == double.NaN)     {       Current = \"ERROR\";       return;     }     Current = Math.Round( result,8).ToString(CultureInfo.InvariantCulture);     CalcExpression = Current;   }   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3076\/\">V3076<\/a> Comparison of &#8216;result&#8217; with &#8216;double.NaN&#8217; is meaningless. Use &#8216;double.IsNaN()&#8217; method instead.<\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u0442, \u0447\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 <em>double.NaN<\/em> \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e. \u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443? \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.double.op_equality?view=netframework-4.8\">MSDN<\/a> \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 <em>NaN<\/em> \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;==&#8217; \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <em>false<\/em>. \u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 <em>double.IsNaN<\/em>.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435, \u043d\u043e, \u0434\u0443\u043c\u0430\u044e, \u043e\u043d\u043e \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432 \u0442\u043e\u043f\u0435, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441 <em>NaN<\/em> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430.<\/p>\n<h3>1 \u043c\u0435\u0441\u0442\u043e. \u0410 \u043c\u043e\u0436\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435\u0442?<\/h3>\n<p>\u0412\u043e\u0442 \u043e\u043d \u2014 \u0432\u0435\u043d\u0435\u0446 \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u0435\u0433\u043e \u0442\u043e\u043f\u0430. \u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u043c\u0435\u0441\u0442\u0435? \u041a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u0435\u043b\u0435\u0439 \u0442\u043e\u043f\u0430. \u042d\u0442\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0432\u0437\u044f\u0442\u043e \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1078\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Microsoft PowerToys<\/a>.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u043c \u043d\u0430\u0439\u0442\u0438 \u043e\u0448\u0438\u0431\u043a\u0443 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e:<\/p>\n<pre><code class=\"cs\">private static int CalculateClosestSpaceIndex(List&lt;int> spaceIndices,                                               int firstMatchIndex) {   if (spaceIndices.Count == 0)   {     return -1;   }   else   {     int? ind = spaceIndices.OrderBy(item => (firstMatchIndex - item))                            .Where(item => firstMatchIndex > item)                            .FirstOrDefault();     int closestSpaceIndex = ind ?? -1;     return closestSpaceIndex;   } } <\/code><\/pre>\n<p>\u0423\u0434\u0430\u043b\u043e\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0432 \u0447\u0451\u043c \u0436\u0435 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430? \u0411\u0443\u0434\u0443 \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u0435\u043b\u0435\u043d, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0441\u0432\u043e\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u0422\u043e\u043b\u044c\u043a\u043e \u0431\u0435\u0437 \u043f\u043e\u0434\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u043d\u0438\u0439 \u0432 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 :).<\/p>\n<details class=\"spoiler\">\n<summary>\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u043f\u0440\u044f\u0442\u0430\u043d\u043e \u0437\u0434\u0435\u0441\u044c.<\/summary>\n<div class=\"spoiler__content\">\n<p> \u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;ind&#8217; is always not null. The operator &#8216;??&#8217; is excessive. StringMatcher.cs 230 <\/p>\n<p>\u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b, \u0447\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;??&#8217; \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u0442\u0430\u043a \u043a\u0430\u043a <em>ind<\/em> \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0435 \u0440\u0430\u0432\u0435\u043d <em>null<\/em>. \u0422\u0430\u043a \u043b\u0438 \u044d\u0442\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435? <em>Ind<\/em> \u0438\u043c\u0435\u0435\u0442 nullable \u0442\u0438\u043f, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0432 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c <em>null<\/em>. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 <em>Ind<\/em>, \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 <em>FirstOrDefault<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c <em>null<\/em>. \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0434\u0435\u043b\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u043e, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u043e\u0448\u0438\u0431\u0441\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435 \u0432\u0441\u0451 \u0442\u0430\u043a \u043f\u0440\u043e\u0441\u0442\u043e. \u041a\u043e\u043f\u043d\u0451\u043c \u0447\u0443\u0442\u044c \u0433\u043b\u0443\u0431\u0436\u0435.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u0435\u0435, \u0442\u043e <em>FirstOrDefault<\/em> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435 <em>null<\/em>, \u0430 <em>default(TSource)<\/em>. <em>default(int?)<\/em> \u2014 \u044d\u0442\u043e <em>null<\/em>. \u0412\u043e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <em>TSource<\/em> \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <em>int<\/em>, \u0442\u0430\u043a \u043a\u0430\u043a <em>TSource<\/em> \u0431\u0435\u0440\u0451\u0442\u0441\u044f \u043f\u043e \u0442\u0438\u043f\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 LINQ \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 <em>spaceIndices<\/em> \u0441 \u0442\u0438\u043f\u043e\u043c <em>List&lt;int><\/em>. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0432 <em>ind<\/em> \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d <em>default(int)<\/em>, \u0442\u043e \u0435\u0441\u0442\u044c 0. \u0410 \u0432\u043e\u0442 \u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043b\u043e\u0433\u0438\u043a\u0435. \u041c\u0435\u0442\u043e\u0434 \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u043d\u0451\u0442 0, \u0430 \u043d\u0435 -1, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u0435\u043d.<\/p>\n<\/div>\n<\/details>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0417\u0430 2023 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b\u0438 \u043d\u0435\u043c\u0430\u043b\u043e C# \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432, \u043d\u043e \u0438 \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u043d\u043e\u0433\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u043c\u0435\u0448\u0430\u043b\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0442\u043e\u043f. \u0414\u0430\u0436\u0435 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442, \u0435\u0441\u0442\u044c \u0440\u044f\u0434 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u044e\u0434\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u044f\u043c \u0442\u043e\u043f\u0430 10-\u0442\u0438.<\/p>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0441\u0442\u043e\u0439\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439, \u043e\u0448\u0438\u0431\u043a\u0438 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e \u0442\u043e\u0439 \u0438\u043b\u0438 \u0438\u043d\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u0438 \u0432 \u044d\u0442\u043e\u0442 \u0442\u043e\u043f:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1083\/\">\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0413\u0440\u043e\u0443\u0432-\u0421\u0442\u0440\u0438\u0442. \u0410\u043d\u0430\u043b\u0438\u0437 \u0434\u0432\u0438\u0436\u043a\u0430 Grand Theft Auto: San Andreas \u043d\u0430 Unity<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1061\/\">\u041e\u0431\u0437\u043e\u0440 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0441\u0442 \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c \u043a\u043e\u0434\u0435 MassTransit<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1070\/\">\u041f\u044f\u0442\u044c \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u043a\u043e\u0434\u0435 Entity Framework Core<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0442\u043e\u043f \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u0438\u043b\u0438 \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 :). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0430\u043c <a href=\"https:\/\/pvs-studio.ru\/ru\/pvs-studio\/try-free\/?utm_source=website&amp;utm_medium=habr&amp;utm_campaign=article&amp;utm_content=1094\">\u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c PVS-Studio<\/a>.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u0441 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0435\u0439, \u0442\u043e \u043f\u0440\u043e\u0448\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434: Nikita Panevin. <a href=\"https:\/\/pvs-studio.com\/en\/blog\/posts\/csharp\/1094\/\">Top 10 errors found in C# projects in 2023<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/782288\/\"> https:\/\/habr.com\/ru\/articles\/782288\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0417\u0430 2023 \u0433\u043e\u0434 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c\u0438 PVS-Studio \u0431\u044b\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0435\u043c\u0430\u043b\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 Open Source C#-\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u041f\u043e \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0438 \u043c\u044b \u0434\u0435\u043b\u0438\u043c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 10-\u044e \u0441\u0430\u043c\u044b\u043c\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u043c\u0438, \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c\u0438 \u0437\u0430 \u044d\u0442\u043e\u0442 \u0433\u043e\u0434. \u041f\u0440\u0438\u044f\u0442\u043d\u043e\u0433\u043e \u0447\u0442\u0435\u043d\u0438\u044f!<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u041a\u0430\u043a \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0442\u043e\u043f?<\/h3>\n<p>\u0414\u043b\u044f \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u044f \u0432 \u0442\u043e\u043f \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c:<\/p>\n<ul>\n<li>\n<p>\u0431\u044b\u0442\u044c \u043a\u043e\u0434\u043e\u043c \u0438\u0437 Open Source \u043f\u0440\u043e\u0435\u043a\u0442\u0430;<\/p>\n<\/li>\n<li>\n<p>\u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PVS-Studio;<\/p>\n<\/li>\n<li>\n<p>\u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u043e\u0448\u0438\u0431\u043a\u0443;<\/p>\n<\/li>\n<li>\n<p>\u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u0435\u0432 \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0442\u044c 10 \u043b\u0443\u0447\u0448\u0438\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. \u0414\u0430, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u043e \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u044f\u043c \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u0438 \u0442\u043e\u043f-10.<\/p>\n<p>\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u043f\u043e\u0434\u0431\u043e\u0440\u043a\u0438 C# \u0431\u0430\u0433\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0437\u0434\u0435\u0441\u044c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1020\/\">\u0442\u043e\u043f-10 \u043e\u0448\u0438\u0431\u043e\u043a \u0437\u0430 2022 \u0433\u043e\u0434<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/0904\/\">\u0442\u043e\u043f-10 \u043e\u0448\u0438\u0431\u043e\u043a \u0437\u0430 2021 \u0433\u043e\u0434<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/0787\/\">\u0442\u043e\u043f-10 \u043e\u0448\u0438\u0431\u043e\u043a \u0437\u0430 2020 \u0433\u043e\u0434<\/a>;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/0698\/\">\u0442\u043e\u043f-10 \u043e\u0448\u0438\u0431\u043e\u043a \u0437\u0430 2019 \u0433\u043e\u0434<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u0442\u043e\u043c\u0438\u0442\u044c, \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0443 \u043d\u043e\u0432\u044b\u0445 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439!<\/p>\n<p>P.S. \u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f \u043a \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0432 \u0442\u043e\u043f\u0435. \u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u043c\u043d\u0435\u043d\u0438\u044f \u0430\u0432\u0442\u043e\u0440\u0430.<\/p>\n<h3>10 \u043c\u0435\u0441\u0442\u043e. \u041d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u044b\u0439 NullReferenceException<\/h3>\n<p>\u041d\u0430\u0448 \u0442\u043e\u043f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1032\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 MudBlazor<\/a>:<\/p>\n<pre><code class=\"cs\">public static bool operator ==(ResizeOptions l, ResizeOptions r)                                                         => l.Equals(r);  public static bool operator !=(ResizeOptions l, ResizeOptions r)                                                         => !l.Equals(r); <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3115\/\">V3115<\/a> Passing &#8216;null&#8217; to &#8216;==&#8217; operator should not result in &#8216;NullReferenceException&#8217;. ResizeOptions.cs 34<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3115\/\">V3115<\/a> Passing &#8216;null&#8217; to &#8216;!=&#8217; operator should not result in &#8216;NullReferenceException&#8217;. ResizeOptions.cs 35<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u0445 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 &#8216;==&#8217; \u0438 &#8216;!=&#8217; \u043b\u0435\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>null<\/em>. \u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <em>l<\/em> \u2013 <em>null<\/em>, \u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Equals<\/em> \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <em>NullReferenceException<\/em>. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Equals<\/em>, \u043a\u0441\u0442\u0430\u0442\u0438, \u0442\u0430\u043a \u0436\u0435 \u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:<\/p>\n<pre><code class=\"cs\">public bool Equals(ResizeOptions other) {   if (ReportRate != other.ReportRate || ....)     \/\/ &lt;=   {     return false;   }   .... } <\/code><\/pre>\n<p>\u0422\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u0432\u0435\u0441\u044c\u043c\u0430 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c \u0441\u044e\u0440\u043f\u0440\u0438\u0437\u043e\u043c \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0435\u0441\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <em>ResizeOptions<\/em>.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 <em>ResizeOptions<\/em> \u0441 <em>null<\/em>.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u043f\u043e\u043b\u043d\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 <em>NullReferenceException<\/em>. \u0415\u0441\u043b\u0438 \u043f\u0440\u0430\u0432\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u2014 <em>null<\/em>, \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438 \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u0441\u044f \u0432 <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/csharp\/programming-guide\/statements-expressions-operators\/how-to-define-value-equality-for-a-type\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Microsoft<\/a>.<\/p>\n<h3>9 \u043c\u0435\u0441\u0442\u043e. \u041f\u0435\u0440\u0435\u0434\u0432\u0438\u043d\u0443\u043b\u0438<\/h3>\n<p>\u041d\u0430 9-\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/cpp\/1078\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Microsoft PowerToys<\/a>:<\/p>\n<pre><code class=\"cs\">public static List&lt;PluginPair> AllPlugins {   get   {     ....     try     {       \/\/ Return a comparable produce version.       var fileVersion = FileVersionInfo.GetVersionInfo(x.ExecuteFilePath);       return ((uint)fileVersion.ProductMajorPart &lt;&lt; 48)       | ((uint)fileVersion.ProductMinorPart &lt;&lt; 32)       | ((uint)fileVersion.ProductBuildPart &lt;&lt; 16)       | ((uint)fileVersion.ProductPrivatePart);       }     catch (System.IO.FileNotFoundException)     {       return 0U;     }     ....   } } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f PVS-Studio:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3134\/\">V3134<\/a> Shift by 48 bits is greater than the size of &#8216;UInt32&#8217; type of expression &#8216;(uint)fileVersion.ProductMajorPart&#8217;. PluginManager.cs 62<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3134\/\">V3134<\/a> Shift by 32 bits is greater than the size of &#8216;UInt32&#8217; type of expression &#8216;(uint)fileVersion.ProductMinorPart&#8217;. PluginManager.cs 63<\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u0439\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430 \u0442\u0438\u043f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u043d\u0430 \u0442\u0438\u043f \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041a\u043e\u0434 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043e\u0442\u0440\u044b\u0432\u043e\u043a \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043b\u044f\u043c\u0431\u0434\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044e. \u0410\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u043b \u043d\u0430 \u043d\u0435\u0433\u043e \u0434\u0432\u0430 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f. \u0422\u0438\u043f <em>uint<\/em> \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 32 \u0431\u0438\u0442\u0430. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0441\u0434\u0432\u0438\u0433 \u043d\u0430 48 \u0431\u0438\u0442 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0441\u0434\u0432\u0438\u0433\u0443 \u043d\u0430 16. \u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u0434\u0432\u0438\u0433 \u043d\u0430 32 \u0431\u0438\u0442\u0430 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u0435\u043d \u0441\u0434\u0432\u0438\u0433\u0443 \u043d\u0430 0 \u0431\u0438\u0442.<\/p>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0445\u043e\u0442\u0435\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u041d\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u043c\u0435\u0441\u0442\u043e <em>uint<\/em> \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <em>ulong<\/em>.<\/p>\n<h3>8 \u043c\u0435\u0441\u0442\u043e. \u0421\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432<\/h3>\n<p>\u041d\u0430 8-\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 \u0440\u0430\u043d\u0435\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u043e\u0439 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1032\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e MudBlazor<\/a>:<\/p>\n<pre><code class=\"cs\">internal void DateValueChanged(DateTime? value) {   _valueDate = value;    if (value != null)   {     var date = value.Value.Date;      \/\/ get the time component and add it to the date.     if (_valueTime != null)     {       date.Add(_valueTime.Value);                    \/\/ &lt;=     }      _filterDefinition.Value = date;   }   else     _filterDefinition.Value = value;    _dataGrid.GroupItems(); } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3010\/\">V3010<\/a> The return value of function &#8216;Add&#8217; is required to be utilized. Filter.cs 140<\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 <em>Add<\/em> \u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u0438\u043f\u0430 <em>DateTime<\/em> \u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0445\u043e\u0442\u0435\u043b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <em>_valueTime.Value<\/em> \u043a <em>date<\/em>. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u043d \u043d\u0435 \u0443\u0447\u0451\u043b, \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <em>Add<\/em> \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0438\u043f\u0430 <em>DateTime<\/em> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0430 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0438\u043c\u0435\u0435\u043c \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0437\u0430\u0434\u0443\u043c\u043a\u0435 \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u043d\u0430 \u0447\u0442\u043e-\u0442\u043e \u0432\u043b\u0438\u044f\u0442\u044c.<\/p>\n<h3>7 \u043c\u0435\u0441\u0442\u043e. \u041f\u043e\u0431\u0438\u0442\u043e\u0432\u0430\u044f \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u0430<\/h3>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u0432\u0437\u044f\u0442\u043e \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1059\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 Ryujinx<\/a>:<\/p>\n<pre><code class=\"cs\">private void YesButton_Clicked(object sender, EventArgs args) {   ....   Window.Functions = _mainWindow.Window.Functions =     WMFunction.All &amp; WMFunction.Close;   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3182\/\">V3182<\/a> The result of &#8216;WMFunction.All &amp; WMFunction.Close&#8217; expression is &#8216;0&#8217;. It is possible that the &#8216;|&#8217; operator should be used instead. UpdateDialog.cs 69<\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u044f, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440 \u0440\u0443\u0433\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 &#8216;&amp;&#8217;. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u0447\u0438\u043d\u0443, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 <em>WMFunction<\/em>:<\/p>\n<pre><code class=\"cs\">[Flags] public enum WMFunction {   All = 0x1,   Resize = 0x2,   Move = 0x4,   Minimize = 0x8,   Maximize = 0x10,   Close = 0x20 } <\/code><\/pre>\n<p>\u041c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441 \u0431\u0438\u0442\u043e\u0432\u044b\u043c\u0438 \u0444\u043b\u0430\u0433\u0430\u043c\u0438, \u043d\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c: \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0418 (&amp;) \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 <em>WMFunction.All<\/em> \u0438 <em>WMFunction.Close<\/em> \u0431\u0443\u0434\u0435\u0442 \u043d\u043e\u043b\u044c.<\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c &#8216;&amp;&#8217; \u043d\u0430 &#8216;|&#8217;.<\/p>\n<h3>6 \u043c\u0435\u0441\u0442\u043e. \u041f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 String.Format<\/h3>\n<p>\u0414\u0432\u0438\u0436\u0435\u043c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435. \u0421\u0435\u0439\u0447\u0430\u0441 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u043d\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1057\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 AWS SDK \u0434\u043b\u044f .NET<\/a>:<\/p>\n<pre><code class=\"cs\">private static string GetXamarinInformation() {   var xamarinDevice = Type.GetType(\"Xamarin.Forms.Device, Xamarin.Forms.Core\");   if (xamarinDevice == null)   {     return null;   }    var runtime = xamarinDevice.GetProperty(\"RuntimePlatform\")                             ?.GetValue(null)                             ?.ToString() ?? \"\";    var idiom = xamarinDevice.GetProperty(\"Idiom\")                           ?.GetValue(null)                           ?.ToString() ?? \"\";    var platform = runtime + idiom;    if (string.IsNullOrEmpty(platform))   {     platform = UnknownPlatform;   }    return string.Format(CultureInfo.InvariantCulture, \"Xamarin_{0}\", \"Xamarin\"); } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3137\/\">V3137<\/a> The &#8216;platform&#8217; variable is assigned but is not used by the end of the function. InternalSDKUtils.netstandard.cs 70<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u043d\u043d\u043e. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <em>String.Format<\/em> \u0432 \u0448\u0430\u0431\u043b\u043e\u043d <em>&#171;Xamarin_{0}&#187;<\/em> \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u043b\u0438\u0442\u0435\u0440\u0430\u043b <em>&#171;Xamarin&#187;.<\/em> \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <em>platform<\/em>, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0442\u0440\u0430\u043d\u043d\u043e.<\/p>\n<p>\u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <em>return<\/em> \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">return string.Format(CultureInfo.InvariantCulture, \"Xamarin_{0}\", platform); <\/code><\/pre>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, \u0440\u044f\u0434\u043e\u043c \u0435\u0441\u0442\u044c \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u0441 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e Unity. \u041e\u043d \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043f\u043e \u0441\u0445\u043e\u0436\u0435\u043c\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0443, \u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u0436\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e:<\/p>\n<pre><code class=\"cs\">private static string GetUnityInformation() {   var unityApplication      = Type.GetType(\"UnityEngine.Application, UnityEngine.CoreModule\");   if (unityApplication == null)   {     return null;   }    var platform = unityApplication.GetProperty(\"platform\")                                 ?.GetValue(null)                                 ?.ToString() ?? UnknownPlatform;    return string.Format(CultureInfo.InvariantCulture, \"Unity_{0}\", platform); } <\/code><\/pre>\n<h3>5 \u043c\u0435\u0441\u0442\u043e. \u0411\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u043c\u0435\u043d\u044c\u0448\u0435?<\/h3>\n<p>\u0412\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u0442\u043e\u043f\u0430 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1051\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 BTCPay Server<\/a>:<\/p>\n<pre><code class=\"cs\">private IActionResult Validate(StoreBaseData request) {   ....   if (request.PaymentTolerance &lt; 0 &amp;&amp; request.PaymentTolerance > 100)     ModelState.AddModelError(nameof(request.PaymentTolerance),       \"PaymentTolerance can only be between 0 and 100 percent\");   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3022\/\">V3022<\/a> Expression &#8216;request.PaymentTolerance &lt; 0 &amp;&amp; request.PaymentTolerance > 100&#8217; is always false. Probably the &#8216;||&#8217; operator should be used here. BTCPayServer\\Controllers\\GreenField\\GreenfieldStoresController.cs 241<\/p>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0445\u043e\u0442\u044c \u0440\u0430\u0437 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u043e\u0442\u043c\u0435\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0438\u0437-\u0437\u0430 \u043d\u0435\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430 \u0432 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445. \u0418\u043d\u043e\u0433\u0434\u0430 \u043e\u043d\u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u0430\u0447\u043d\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043e \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0432 \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0435\u0441\u0442\u044c \u0433\u043b\u0443\u043f\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430.<\/p>\n<p>\u0422\u0430\u043a, \u0432 \u044d\u0442\u043e\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u043a\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u043f\u0443\u0442\u0430\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b &#8216;&amp;&amp;&#8217; \u0438 &#8216;||&#8217;. \u041a\u043e\u0434 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043e\u0442 0 \u0434\u043e 100, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0434\u0430\u043d\u043e.<\/p>\n<p>\u041a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u043d\u0435\u0432\u0435\u0440\u043d\u043e \u0432\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442 \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u043e \u043a\u043e\u0434\u0443 \u0438 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043e\u0448\u0438\u0431\u043a\u0435 \u0432 \u043b\u043e\u0433\u0438\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h3>4 \u043c\u0435\u0441\u0442\u043e. \u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b<\/h3>\n<p>\u041d\u0430 4-\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u043b\u043e\u0441\u044c \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u0443\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0444\u0438\u043d\u0430\u043b\u0438\u0441\u0442\u0430\u043c. \u0415\u0433\u043e \u044f \u0432\u0437\u044f\u043b \u0438\u0437 <a href=\"https:\/\/pvs-studio.ru\/ru\/blog\/posts\/csharp\/1032\/\">\u0441\u0442\u0430\u0442\u044c\u0438 \u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 MudBlazor<\/a>.<\/p>\n<pre><code class=\"cs\">internal async Task&lt;bool> StartResizeColumn(....) {   ....   \/\/ In case resize mode is column, we have to find any column right   \/\/ of the current one that can also be resized and is not hidden.    var nextResizableColumn = _columns.Skip(_....) + 1)                                     .FirstOrDefault(c =>                                         c.Resizable ?? true &amp;&amp; !c.Hidden); \/\/ &lt;=   .... } <\/code><\/pre>\n<p>\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 PVS-Studio: <a href=\"https:\/\/pvs-studio.ru\/ru\/docs\/warnings\/v3177\/\">V3177<\/a> The &#8216;true&#8217; literal belongs to the &#8216;&amp;&amp;&#8217; operator with a higher priority. It is possible the literal was intended to belong to &#8216;??&#8217; operator instead. DataGridColumnResizeService.cs 52<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <em>c.Resizable ?? true &amp;&amp; !c.Hidden<\/em>. \u0421\u0442\u043e\u0438\u0442 \u0441\u0440\u0430\u0437\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0443 &#8216;??&#8217; \u043d\u0438\u0436\u0435, \u0447\u0435\u043c \u0443 &#8216;&amp;&amp;&#8217;. \u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u044d\u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 <em>c.Resizable<\/em> \u2014 <em>null<\/em>, \u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 null-coalescing \u0432\u0435\u0440\u043d\u0451\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 <em>true &amp;&amp; !c.Hidden<\/em>. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f &#171;&amp;&amp;&#187; \u0441 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u043c <em>true<\/em> \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u0430. \u0421\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">(c.Re<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-363617","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/363617","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=363617"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/363617\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=363617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=363617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=363617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}