File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed
src/Uno.UI.RemoteControl/HotReload/Messages Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
3+ using System . Linq ;
34using System . Text ;
45
56namespace Uno . UI . RemoteControl . HotReload . Messages ;
67
78/// <summary>
8- ///
9+ /// Configuration message sent from the client to the server to initialize hot reload functionality.
910/// </summary>
1011/// <param name="ProjectPath"></param>
1112/// <param name="MetadataUpdateCapabilities"></param>
@@ -36,16 +37,10 @@ public record ConfigureServer(
3637 public Dictionary < string , string > MSBuildProperties => _msbuildProperties ??= ParseMSBuildProperties ( MSBuildPropertiesRaw ) ;
3738
3839 public static Dictionary < string , string > ParseMSBuildProperties ( string [ ] rawMSBuildProperties )
39- {
40- var msbuildPropertiesCache = new Dictionary < string , string > ( ) ;
41-
42- foreach ( var property in rawMSBuildProperties )
43- {
44- var firstEqual = property . IndexOf ( '=' ) ;
45- var split = new [ ] { property . Substring ( 0 , firstEqual ) , property . Substring ( firstEqual + 1 ) } ;
46- msbuildPropertiesCache . Add ( split [ 0 ] , Encoding . UTF8 . GetString ( Convert . FromBase64String ( split [ 1 ] ) ) ) ;
47- }
48-
49- return msbuildPropertiesCache ;
50- }
40+ => rawMSBuildProperties
41+ . Select ( property => property . Split ( '=' , 2 ) )
42+ . Where ( tokens => tokens . Length == 2 )
43+ . ToDictionary (
44+ tokens => tokens [ 0 ] ,
45+ split => Encoding . UTF8 . GetString ( Convert . FromBase64String ( split [ 1 ] ) ) ) ;
5146}
You can’t perform that action at this time.
0 commit comments