From e0939b3a918cff4b32b376c4d758ba3aa9fbaf06 Mon Sep 17 00:00:00 2001 From: Andrey Shchekin Date: Sun, 3 Dec 2023 22:59:00 +1300 Subject: [PATCH] Update to latest Roslyn --- source/NetFramework/Server/Server.csproj | 8 +- source/NetFramework/Server/Web.config | 28 +++-- source/Server/Server.csproj | 8 +- .../TestCode/Switch.String.Large.cs | 105 ++++++++---------- 4 files changed, 70 insertions(+), 79 deletions(-) diff --git a/source/NetFramework/Server/Server.csproj b/source/NetFramework/Server/Server.csproj index 6adad63e0..a501a5d03 100644 --- a/source/NetFramework/Server/Server.csproj +++ b/source/NetFramework/Server/Server.csproj @@ -24,10 +24,10 @@ - - - - + + + + diff --git a/source/NetFramework/Server/Web.config b/source/NetFramework/Server/Web.config index a95f4721c..272a201e8 100644 --- a/source/NetFramework/Server/Web.config +++ b/source/NetFramework/Server/Web.config @@ -45,31 +45,31 @@ - + - + - + - + - + @@ -87,13 +87,13 @@ - + - + @@ -111,7 +111,7 @@ - + @@ -135,19 +135,19 @@ - + - + - + @@ -162,5 +162,11 @@ + + + + + + \ No newline at end of file diff --git a/source/Server/Server.csproj b/source/Server/Server.csproj index 57fe72e6d..9a7b9db26 100644 --- a/source/Server/Server.csproj +++ b/source/Server/Server.csproj @@ -38,10 +38,10 @@ - - - - + + + + diff --git a/source/Tests/Decompilation/TestCode/Switch.String.Large.cs b/source/Tests/Decompilation/TestCode/Switch.String.Large.cs index bf63229cb..8798109c6 100644 --- a/source/Tests/Decompilation/TestCode/Switch.String.Large.cs +++ b/source/Tests/Decompilation/TestCode/Switch.String.Large.cs @@ -38,75 +38,60 @@ public class C [NullableContext(1)] public string M(string key) { - uint num = .ComputeStringHash(key); - if (num <= 455788110) + if (key != null) { - if (num != 422232872) + int length = key.Length; + if (length == 4) { - if (num != 439010491) + switch (key[3]) { - if (num == 455788110 && key == "Key6") - { + case '1': + if (!(key == "Key1")) + { + break; + } + return "1"; + case '2': + if (!(key == "Key2")) + { + break; + } + return "2"; + case '3': + if (!(key == "Key3")) + { + break; + } + return "3"; + case '4': + if (!(key == "Key4")) + { + break; + } + return "4"; + case '5': + if (!(key == "Key5")) + { + break; + } + return "5"; + case '6': + if (!(key == "Key6")) + { + break; + } return "6"; - } - } - else if (key == "Key5") - { - return "5"; - } - } - else if (key == "Key4") - { - return "4"; - } - } - else if (num <= 506120967) - { - if (num != 472565729) - { - if (num == 506120967 && key == "Key1") - { - return "1"; + case '7': + if (!(key == "Key7")) + { + break; + } + return "7"; } } - else if (key == "Key7") - { - return "7"; - } - } - else if (num != 522898586) - { - if (num == 539676205 && key == "Key3") - { - return "3"; - } - } - else if (key == "Key2") - { - return "2"; } return "?"; } } -[CompilerGenerated] -internal sealed class -{ - internal static uint ComputeStringHash(string s) - { - uint num = default(uint); - if (s != null) - { - num = 2166136261u; - int num2 = 0; - while (num2 < s.Length) - { - num = (s[num2] ^ num) * 16777619; - num2++; - } - } - return num; - } -} - */ \ No newline at end of file