Simplify for loops
MODIFY
WalletWasabi/Helpers/HttpMessageHelper.cs
WalletWasabi/Helpers/HttpMessageHelper.cs
@@ -308,10 +308,7 @@ namespace System.Net.Http
throw new FormatException("Chunk does not end with CRLF.");
}
- foreach (var b in chunkData)
- {
- decodedBody.Add(b);
- }
+ decodedBody.AddRange(chunkData);
length += chunkSize;

MODIFY
WalletWasabi/WebClients/ChaumianCoinJoin/AliceClient.cs
WalletWasabi/WebClients/ChaumianCoinJoin/AliceClient.cs
@@ -156,11 +156,7 @@ namespace WalletWasabi.WebClients.ChaumianCoinJoin
public async Task PostSignaturesAsync(IDictionary<int, WitScript> signatures)
{
- var myDic = new Dictionary<int, string>();
- foreach (var signature in signatures)
- {
- myDic.Add(signature.Key, signature.Value.ToString());
- }
+ var myDic = signatures.ToDictionary(signature => signature.Key, signature => signature.Value.ToString());
var jsonSignatures = JsonConvert.SerializeObject(myDic, Formatting.None);
var signatureRequestContent = new StringContent(jsonSignatures, Encoding.UTF8, "application/json");

Simplify for loops