Simplify new expression
MODIFY
WalletWasabi/Gma/QRCodeDecoder/QRDecoder.cs
WalletWasabi/Gma/QRCodeDecoder/QRDecoder.cs
@@ -1085,7 +1085,7 @@ namespace QRCodeDecoderLibrary
internal List<Corner>? BuildCornerList()
{
// empty list
- List<Corner> corners = new List<Corner>();
+ List<Corner> corners = new();
// look for all possible 3 finder patterns
int index1End = FinderList.Count - 2;
@@ -1984,7 +1984,7 @@ namespace QRCodeDecoderLibrary
CodewordsPtr = 4;
// allocate data byte list
- List<byte> dataSeg = new List<byte>();
+ List<byte> dataSeg = new();
// reset ECI assignment value
ECIAssignValue = -1;

MODIFY
WalletWasabi/Gma/QRCodeDecoder/QRHandler.cs
WalletWasabi/Gma/QRCodeDecoder/QRHandler.cs
@@ -109,7 +109,7 @@ namespace QRCodeDecoder
}
// image has more than one QR code
- StringBuilder str = new StringBuilder();
+ StringBuilder str = new();
for (int index = 0; index < dataByteArray.Length; index++)
{
if (index != 0)
@@ -139,7 +139,7 @@ namespace QRCodeDecoder
return result;
}
- StringBuilder display = new StringBuilder(result.Substring(0, index));
+ StringBuilder display = new(result.Substring(0, index));
for (; index < result.Length; index++)
{
char oneChar = result[index];

Simplify new expression