@@ -40,14 +40,15 @@ public IAsyncEnumerable<string> ExecuteRemoteEnumerableAsync(string command, Dev
4040
4141 public void ExecuteServerCommand ( string target , string command )
4242 {
43- StringBuilder requestBuilder = new ( ) ;
43+ DefaultInterpolatedStringHandler requestBuilder = new ( 1 , 2 ) ;
4444 if ( ! string . IsNullOrWhiteSpace ( target ) )
4545 {
46- _ = requestBuilder . Append ( target ) . Append ( ':' ) ;
46+ requestBuilder . AppendLiteral ( target ) ;
47+ requestBuilder . AppendFormatted ( ':' ) ;
4748 }
48- _ = requestBuilder . Append ( command ) ;
49+ requestBuilder . AppendLiteral ( command ) ;
4950
50- string request = requestBuilder . ToString ( ) ;
51+ string request = requestBuilder . ToStringAndClear ( ) ;
5152 ReceivedCommands . Add ( request ) ;
5253 }
5354
@@ -56,14 +57,15 @@ public void ExecuteServerCommand(string target, string command, IAdbSocket socke
5657
5758 public void ExecuteServerCommand ( string target , string command , IShellOutputReceiver receiver , Encoding encoding )
5859 {
59- StringBuilder requestBuilder = new ( ) ;
60+ DefaultInterpolatedStringHandler requestBuilder = new ( 1 , 2 ) ;
6061 if ( ! string . IsNullOrWhiteSpace ( target ) )
6162 {
62- _ = requestBuilder . Append ( target ) . Append ( ':' ) ;
63+ requestBuilder . AppendLiteral ( target ) ;
64+ requestBuilder . AppendFormatted ( ':' ) ;
6365 }
64- _ = requestBuilder . Append ( command ) ;
66+ requestBuilder . AppendLiteral ( command ) ;
6567
66- string request = requestBuilder . ToString ( ) ;
68+ string request = requestBuilder . ToStringAndClear ( ) ;
6769 ReceivedCommands . Add ( request ) ;
6870
6971 if ( Commands . TryGetValue ( request , out string value ) )
@@ -91,14 +93,15 @@ public void ExecuteServerCommand(string target, string command, IAdbSocket socke
9193
9294 public IEnumerable < string > ExecuteServerEnumerable ( string target , string command , Encoding encoding )
9395 {
94- StringBuilder requestBuilder = new ( ) ;
96+ DefaultInterpolatedStringHandler requestBuilder = new ( 1 , 2 ) ;
9597 if ( ! string . IsNullOrWhiteSpace ( target ) )
9698 {
97- _ = requestBuilder . Append ( target ) . Append ( ':' ) ;
99+ requestBuilder . AppendLiteral ( target ) ;
100+ requestBuilder . AppendFormatted ( ':' ) ;
98101 }
99- _ = requestBuilder . Append ( command ) ;
102+ requestBuilder . AppendLiteral ( command ) ;
100103
101- string request = requestBuilder . ToString ( ) ;
104+ string request = requestBuilder . ToStringAndClear ( ) ;
102105 ReceivedCommands . Add ( request ) ;
103106
104107 if ( Commands . TryGetValue ( request , out string value ) )
@@ -122,14 +125,15 @@ public async Task ExecuteServerCommandAsync(string target, string command, Cance
122125 {
123126 await Task . Yield ( ) ;
124127
125- StringBuilder requestBuilder = new ( ) ;
128+ DefaultInterpolatedStringHandler requestBuilder = new ( 1 , 2 ) ;
126129 if ( ! string . IsNullOrWhiteSpace ( target ) )
127130 {
128- _ = requestBuilder . Append ( target ) . Append ( ':' ) ;
131+ requestBuilder . AppendLiteral ( target ) ;
132+ requestBuilder . AppendFormatted ( ':' ) ;
129133 }
130- _ = requestBuilder . Append ( command ) ;
134+ requestBuilder . AppendLiteral ( command ) ;
131135
132- string request = requestBuilder . ToString ( ) ;
136+ string request = requestBuilder . ToStringAndClear ( ) ;
133137 ReceivedCommands . Add ( request ) ;
134138 }
135139
@@ -138,14 +142,15 @@ public Task ExecuteServerCommandAsync(string target, string command, IAdbSocket
138142
139143 public async Task ExecuteServerCommandAsync ( string target , string command , IShellOutputReceiver receiver , Encoding encoding , CancellationToken cancellationToken = default )
140144 {
141- StringBuilder requestBuilder = new ( ) ;
145+ DefaultInterpolatedStringHandler requestBuilder = new ( 1 , 2 ) ;
142146 if ( ! string . IsNullOrWhiteSpace ( target ) )
143147 {
144- _ = requestBuilder . Append ( target ) . Append ( ':' ) ;
148+ requestBuilder . AppendLiteral ( target ) ;
149+ requestBuilder . AppendFormatted ( ':' ) ;
145150 }
146- _ = requestBuilder . Append ( command ) ;
151+ requestBuilder . AppendLiteral ( command ) ;
147152
148- string request = requestBuilder . ToString ( ) ;
153+ string request = requestBuilder . ToStringAndClear ( ) ;
149154 ReceivedCommands . Add ( request ) ;
150155
151156 if ( Commands . TryGetValue ( request , out string value ) )
@@ -173,14 +178,15 @@ public Task ExecuteServerCommandAsync(string target, string command, IAdbSocket
173178
174179 public async IAsyncEnumerable < string > ExecuteServerEnumerableAsync ( string target , string command , Encoding encoding , [ EnumeratorCancellation ] CancellationToken cancellationToken )
175180 {
176- StringBuilder requestBuilder = new ( ) ;
181+ DefaultInterpolatedStringHandler requestBuilder = new ( 1 , 2 ) ;
177182 if ( ! string . IsNullOrWhiteSpace ( target ) )
178183 {
179- _ = requestBuilder . Append ( target ) . Append ( ':' ) ;
184+ requestBuilder . AppendLiteral ( target ) ;
185+ requestBuilder . AppendFormatted ( ':' ) ;
180186 }
181- _ = requestBuilder . Append ( command ) ;
187+ requestBuilder . AppendLiteral ( command ) ;
182188
183- string request = requestBuilder . ToString ( ) ;
189+ string request = requestBuilder . ToStringAndClear ( ) ;
184190 ReceivedCommands . Add ( request ) ;
185191
186192 if ( Commands . TryGetValue ( request , out string value ) )
0 commit comments