Skip to content

Commit e8c8b1e

Browse files
committed
Avoid allocating empty arrays
CA1825: Avoid zero-length array allocations https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1825
1 parent c853d26 commit e8c8b1e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+127
-116
lines changed

src/TaglibSharp.Tests/Images/AddImageMetadataTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public static void AddXMPTest2 (string sample_file, string tmp_file, bool contai
108108
xmp_tag.Comment = null;
109109
xmp_tag.Software = test_comment;
110110

111-
Assert.AreEqual (new string[] { }, xmp_tag.Keywords);
111+
Assert.AreEqual (Array.Empty<string> (), xmp_tag.Keywords);
112112
Assert.AreEqual (null, xmp_tag.Comment);
113113
Assert.AreEqual (test_comment, xmp_tag.Software);
114114

@@ -119,7 +119,7 @@ public static void AddXMPTest2 (string sample_file, string tmp_file, bool contai
119119
xmp_tag = file.GetTag (TagTypes.XMP, false) as XmpTag;
120120
Assert.IsNotNull (xmp_tag, "XMP Tag not read");
121121

122-
Assert.AreEqual (new string[] { }, xmp_tag.Keywords);
122+
Assert.AreEqual (Array.Empty<string> (), xmp_tag.Keywords);
123123
Assert.AreEqual (null, xmp_tag.Comment);
124124
Assert.AreEqual (test_comment, xmp_tag.Software);
125125
}

src/TaglibSharp.Tests/Images/CopyFromTest.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public void TestJPGtoTIFF ()
2121
Assert.AreEqual (TagTypes.TiffIFD | TagTypes.XMP, file2.TagTypes);
2222
Assert.AreEqual ("%test comment%", file1.ImageTag.Comment);
2323
Assert.AreEqual (string.Empty, file2.ImageTag.Comment);
24-
Assert.AreEqual (new string[] { }, file1.ImageTag.Keywords);
25-
Assert.AreEqual (new string[] { }, file2.ImageTag.Keywords);
24+
Assert.AreEqual (Array.Empty<string> (), file1.ImageTag.Keywords);
25+
Assert.AreEqual (Array.Empty<string> (), file2.ImageTag.Keywords);
2626
Assert.AreEqual (null, file1.ImageTag.Rating);
2727
Assert.AreEqual (0, file2.ImageTag.Rating);
2828
Assert.AreEqual (new DateTime (2009, 8, 9, 19, 12, 44), (DateTime)file1.ImageTag.DateTime);
@@ -62,8 +62,8 @@ public void TestJPGtoTIFF ()
6262
Assert.AreEqual (TagTypes.TiffIFD | TagTypes.XMP, file2.TagTypes);
6363
Assert.AreEqual ("%test comment%", file1.ImageTag.Comment);
6464
Assert.AreEqual ("%test comment%", file2.ImageTag.Comment);
65-
Assert.AreEqual (new string[] { }, file1.ImageTag.Keywords);
66-
Assert.AreEqual (new string[] { }, file2.ImageTag.Keywords);
65+
Assert.AreEqual (Array.Empty<string> (), file1.ImageTag.Keywords);
66+
Assert.AreEqual (Array.Empty<string> (), file2.ImageTag.Keywords);
6767
Assert.AreEqual (null, file1.ImageTag.Rating);
6868
Assert.AreEqual (null, file2.ImageTag.Rating);
6969
Assert.AreEqual (new DateTime (2009, 8, 9, 19, 12, 44), (DateTime)file1.ImageTag.DateTime);

src/TaglibSharp.Tests/Images/GifExiftoolLongCommentTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void Test ()
2020
true,
2121
new GifExiftoolLongCommentTestInvariantValidator (),
2222
NoModificationValidator.Instance,
23-
new TagKeywordsModificationValidator (new string[] { }, TagTypes.XMP, true),
23+
new TagKeywordsModificationValidator (Array.Empty<string> (), TagTypes.XMP, true),
2424
new CommentModificationValidator (long_comment_orig),
2525
new CommentModificationValidator (long_comment_orig, long_comment_test),
2626
new TagCommentModificationValidator (long_comment_orig, TagTypes.GifComment, true),

src/TaglibSharp.Tests/Images/GifExiftoolTangled3Test.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public void Test ()
1919
true,
2020
new GifExiftoolTangled3TestInvariantValidator (),
2121
NoModificationValidator.Instance,
22-
new TagKeywordsModificationValidator (new string[] { }, TagTypes.XMP, false),
22+
new TagKeywordsModificationValidator (Array.Empty<string> (), TagTypes.XMP, false),
2323
new CommentModificationValidator ("Created with GIMP"),
2424
new TagCommentModificationValidator ("Created with GIMP", TagTypes.GifComment, true),
2525
new RemoveMetadataValidator (TagTypes.GifComment)

src/TaglibSharp.Tests/Images/ImageTagTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void TestXMPImageTag ()
2020
Assert.IsNotNull (tag);
2121

2222
Assert.AreEqual (null, tag.Comment, "Comment");
23-
Assert.AreEqual (new string[] { }, tag.Keywords, "Keywords");
23+
Assert.AreEqual (Array.Empty<string> (), tag.Keywords, "Keywords");
2424
Assert.AreEqual (0, tag.Rating, "Rating");
2525
Assert.AreEqual (null, tag.DateTime, "DateTime");
2626
Assert.AreEqual (ImageOrientation.None, tag.Orientation, "Orientation");

src/TaglibSharp.Tests/Images/JpegNikon1Bibble5Test.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void Test ()
2020
new CommentModificationValidator (string.Empty),
2121
new TagCommentModificationValidator (null, TagTypes.TiffIFD, true),
2222
new TagCommentModificationValidator (null, TagTypes.XMP, true),
23-
new TagKeywordsModificationValidator (new string[] { }, TagTypes.XMP, true)
23+
new TagKeywordsModificationValidator (Array.Empty<string> (), TagTypes.XMP, true)
2424
);
2525
}
2626
}

src/TaglibSharp.Tests/Images/JpegNikon2Bibble5Test.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void Test ()
2020
new CommentModificationValidator (string.Empty),
2121
new TagCommentModificationValidator (null, TagTypes.TiffIFD, true),
2222
new TagCommentModificationValidator (null, TagTypes.XMP, true),
23-
new TagKeywordsModificationValidator (new string[] { }, TagTypes.XMP, true)
23+
new TagKeywordsModificationValidator (Array.Empty<string> (), TagTypes.XMP, true)
2424
);
2525
}
2626
}

src/TaglibSharp.Tests/Images/JpegOlympus2Test.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public void CheckXMP (File file)
165165

166166
Assert.IsNotNull (tag, "tag");
167167

168-
Assert.AreEqual (new string[] { }, tag.Keywords);
168+
Assert.AreEqual (Array.Empty<string> (), tag.Keywords);
169169
Assert.AreEqual ("OLYMPUS CORPORATION", tag.Make);
170170
Assert.AreEqual ("C5060WZ", tag.Model);
171171
Assert.AreEqual ("Adobe Photoshop Elements 4.0", tag.Software);

src/TaglibSharp.Tests/Images/PefPentaxKd10Test.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void ValidateMetadataInvariants (TagLib.Image.File file)
3030
var imagetag = file.ImageTag;
3131
Assert.IsNotNull (imagetag);
3232
Assert.AreEqual (String.Empty, imagetag.Comment, "Comment");
33-
Assert.AreEqual (new string[] { }, imagetag.Keywords, "Keywords");
33+
Assert.AreEqual (Array.Empty<string> (), imagetag.Keywords, "Keywords");
3434
Assert.AreEqual (null, imagetag.Rating, "Rating");
3535
Assert.AreEqual (TagLib.Image.ImageOrientation.LeftBottom, imagetag.Orientation, "Orientation");
3636
Assert.AreEqual ("K10D Ver 1.31 ", imagetag.Software, "Software");

src/TaglibSharp.Tests/Images/RawLeicaDigilux2Test.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void ValidateMetadataInvariants (TagLib.Image.File file)
2626
var imagetag = file.ImageTag;
2727
Assert.IsNotNull (imagetag);
2828
Assert.AreEqual (String.Empty, imagetag.Comment, "Comment");
29-
Assert.AreEqual (new string[] { }, imagetag.Keywords, "Keywords");
29+
Assert.AreEqual (Array.Empty<string> (), imagetag.Keywords, "Keywords");
3030
Assert.AreEqual (null, imagetag.Rating, "Rating");
3131
Assert.AreEqual (TagLib.Image.ImageOrientation.TopLeft, imagetag.Orientation, "Orientation");
3232
Assert.AreEqual (null, imagetag.Software, "Software");

src/TaglibSharp.Tests/Images/RecursiveIFDTest.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System;
2+
13
using NUnit.Framework;
24
using TagLib;
35
using TagLib.IFD;
@@ -259,7 +261,7 @@ public void ValidateMetadataInvariants (TagLib.Image.File file)
259261
Assert.IsNotNull (entry, "Entry 0x92D6 missing in IFD 0");
260262
Assert.IsNotNull (entry as UndefinedIFDEntry, "Entry is not an undefined IFD entry!");
261263
var parsed_bytes = (entry as UndefinedIFDEntry).Data.Data;
262-
var bytes = new byte[] { };
264+
var bytes = Array.Empty<byte> ();
263265
Assert.AreEqual (bytes, parsed_bytes);
264266
}
265267
// Thumbnail.0x0103 (Compression/Short/1) "6"

src/TaglibSharp.Tests/Images/Rw2PanasonicG1Test.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void ValidateMetadataInvariants (TagLib.Image.File file)
3333
var imagetag = file.ImageTag;
3434
Assert.IsNotNull (imagetag);
3535
Assert.AreEqual (String.Empty, imagetag.Comment, "Comment");
36-
Assert.AreEqual (new string[] { }, imagetag.Keywords, "Keywords");
36+
Assert.AreEqual (Array.Empty<string> (), imagetag.Keywords, "Keywords");
3737
Assert.AreEqual (null, imagetag.Rating, "Rating");
3838
Assert.AreEqual (TagLib.Image.ImageOrientation.TopLeft, imagetag.Orientation, "Orientation");
3939
Assert.AreEqual (null, imagetag.Software, "Software");

src/TaglibSharp.Tests/Images/TiffCanonBibble516BitTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void Test ()
2020
new CommentModificationValidator (string.Empty),
2121
new TagCommentModificationValidator (null, TagTypes.TiffIFD, true),
2222
new TagCommentModificationValidator (null, TagTypes.XMP, true),
23-
new TagKeywordsModificationValidator (new string[] { }, TagTypes.XMP, true)
23+
new TagKeywordsModificationValidator (Array.Empty<string> (), TagTypes.XMP, true)
2424
);
2525
}
2626
}

src/TaglibSharp.Tests/Images/TiffCanonBibble58BitTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void Test ()
2020
new CommentModificationValidator (string.Empty),
2121
new TagCommentModificationValidator (null, TagTypes.TiffIFD, true),
2222
new TagCommentModificationValidator (null, TagTypes.XMP, true),
23-
new TagKeywordsModificationValidator (new string[] { }, TagTypes.XMP, true)
23+
new TagKeywordsModificationValidator (Array.Empty<string> (), TagTypes.XMP, true)
2424
);
2525
}
2626
}

src/TaglibSharp.Tests/Images/TiffNikon1Bibble516BitTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void Test ()
2020
new CommentModificationValidator (string.Empty),
2121
new TagCommentModificationValidator (null, TagTypes.TiffIFD, true),
2222
new TagCommentModificationValidator (null, TagTypes.XMP, true),
23-
new TagKeywordsModificationValidator (new string[] { }, TagTypes.XMP, true)
23+
new TagKeywordsModificationValidator (Array.Empty<string> (), TagTypes.XMP, true)
2424
);
2525
}
2626
}

src/TaglibSharp.Tests/Images/TiffNikon1Bibble58BitTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void Test ()
2020
new CommentModificationValidator (string.Empty),
2121
new TagCommentModificationValidator (null, TagTypes.TiffIFD, true),
2222
new TagCommentModificationValidator (null, TagTypes.XMP, true),
23-
new TagKeywordsModificationValidator (new string[] { }, TagTypes.XMP, true)
23+
new TagKeywordsModificationValidator (Array.Empty<string> (), TagTypes.XMP, true)
2424
);
2525
}
2626
}

src/TaglibSharp.Tests/Images/TiffNikon2Bibble516BitTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void Test ()
2020
new CommentModificationValidator (string.Empty),
2121
new TagCommentModificationValidator (null, TagTypes.TiffIFD, true),
2222
new TagCommentModificationValidator (null, TagTypes.XMP, true),
23-
new TagKeywordsModificationValidator (new string[] { }, TagTypes.XMP, true)
23+
new TagKeywordsModificationValidator (Array.Empty<string> (), TagTypes.XMP, true)
2424
);
2525
}
2626
}

src/TaglibSharp.Tests/Images/TiffNikon2Bibble58BitTest.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public void Test ()
2020
new CommentModificationValidator (string.Empty),
2121
new TagCommentModificationValidator (null, TagTypes.TiffIFD, true),
2222
new TagCommentModificationValidator (null, TagTypes.XMP, true),
23-
new TagKeywordsModificationValidator (new string[] { }, TagTypes.XMP, true)
23+
new TagKeywordsModificationValidator (Array.Empty<string> (), TagTypes.XMP, true)
2424
);
2525
}
2626
}

src/TaglibSharp.Tests/Images/Validators/KeywordsModificationValidator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class KeywordsModificationValidator : IMetadataModificationValidator
1212
readonly string[] orig_keywords;
1313
readonly string[] test_keywords = { "keyword 1", "§$&§%", "99 dsf", "ഈ ヰᛥกツ" };
1414

15-
public KeywordsModificationValidator () : this (new string[] { }) { }
15+
public KeywordsModificationValidator () : this (Array.Empty<string> ()) { }
1616

1717
public KeywordsModificationValidator (string[] orig_keywords)
1818
{

src/TaglibSharp.Tests/Images/Validators/TagKeywordsModificationValidator.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class TagKeywordsModificationValidator : KeywordsModificationValidator
1212
readonly bool tag_present;
1313
readonly TagTypes type;
1414

15-
public TagKeywordsModificationValidator (TagTypes type, bool tag_present) : this (new string[] { }, type, tag_present) { }
15+
public TagKeywordsModificationValidator (TagTypes type, bool tag_present) : this (Array.Empty<string> (), type, tag_present) { }
1616

1717
public TagKeywordsModificationValidator (string[] orig_keywords, TagTypes type, bool tag_present) : base (orig_keywords)
1818
{

src/TaglibSharp.Tests/TaggingFormats/ApeTest.cs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System;
2+
13
using NUnit.Framework;
24
using TagLib;
35
using Tag = TagLib.Ape.Tag;
@@ -61,7 +63,7 @@ public void TestPerformers ()
6163
}
6264
});
6365

64-
tag.Performers = new string[0];
66+
tag.Performers = Array.Empty<string> ();
6567

6668
TagTestWithSave (ref tag, delegate (Tag t, string m) {
6769
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);
@@ -89,7 +91,7 @@ public void TestAlbumArtists ()
8991
}
9092
});
9193

92-
tag.AlbumArtists = new string[0];
94+
tag.AlbumArtists = Array.Empty<string> ();
9395

9496
TagTestWithSave (ref tag, delegate (Tag t, string m) {
9597
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);
@@ -117,7 +119,7 @@ public void TestComposers ()
117119
}
118120
});
119121

120-
tag.Composers = new string[0];
122+
tag.Composers = Array.Empty<string> ();
121123

122124
TagTestWithSave (ref tag, delegate (Tag t, string m) {
123125
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);
@@ -205,7 +207,7 @@ public void TestGenres ()
205207
}
206208
});
207209

208-
tag.Genres = new string[0];
210+
tag.Genres = Array.Empty<string> ();
209211

210212
TagTestWithSave (ref tag, delegate (Tag t, string m) {
211213
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);
@@ -501,7 +503,7 @@ public void TestPictures ()
501503
}
502504
});
503505

504-
tag.Pictures = new Picture[0];
506+
tag.Pictures = Array.Empty<Picture> ();
505507

506508
TagTestWithSave (ref tag, delegate (Tag t, string m) {
507509
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);

src/TaglibSharp.Tests/TaggingFormats/AsfTest.cs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System;
2+
13
using NUnit.Framework;
24
using TagLib;
35
using File = TagLib.Asf.File;
@@ -60,7 +62,7 @@ public void TestPerformers ()
6062
}
6163
});
6264

63-
file.Tag.Performers = new string[0];
65+
file.Tag.Performers = Array.Empty<string> ();
6466

6567
TagTestWithSave (ref file, abst, delegate (Tag t, string m) {
6668
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);
@@ -88,7 +90,7 @@ public void TestAlbumArtists ()
8890
}
8991
});
9092

91-
file.Tag.AlbumArtists = new string[0];
93+
file.Tag.AlbumArtists = Array.Empty<string> ();
9294

9395
TagTestWithSave (ref file, abst, delegate (Tag t, string m) {
9496
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);
@@ -116,7 +118,7 @@ public void TestComposers ()
116118
}
117119
});
118120

119-
file.Tag.Composers = new string[0];
121+
file.Tag.Composers = Array.Empty<string> ();
120122

121123
TagTestWithSave (ref file, abst, delegate (Tag t, string m) {
122124
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);
@@ -204,7 +206,7 @@ public void TestGenres ()
204206
}
205207
});
206208

207-
file.Tag.Genres = new string[0];
209+
file.Tag.Genres = Array.Empty<string> ();
208210

209211
TagTestWithSave (ref file, abst, delegate (Tag t, string m) {
210212
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);
@@ -500,7 +502,7 @@ public void TestPictures ()
500502
}
501503
});
502504

503-
file.Tag.Pictures = new Picture[0];
505+
file.Tag.Pictures = Array.Empty<Picture> ();
504506

505507
TagTestWithSave (ref file, abst, delegate (Tag t, string m) {
506508
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);

src/TaglibSharp.Tests/TaggingFormats/DivXTest.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void TestPerformers ()
5959
Assert.IsFalse (tag.IsEmpty, "Still not empty");
6060
Assert.AreEqual ("A123456789; B123456789; C12345", tag.JoinedPerformers);
6161

62-
tag.Performers = new string[0];
62+
tag.Performers = Array.Empty<string> ();
6363
Assert.IsTrue (tag.IsEmpty, "Again empty");
6464
Assert.AreEqual (0, tag.Performers.Length, "Again empty");
6565

@@ -164,7 +164,7 @@ public void TestGenres ()
164164
Assert.IsTrue (tag.IsEmpty, "Still empty");
165165
Assert.AreEqual (0, tag.Genres.Length, "Still empty");
166166

167-
tag.Genres = new string[0];
167+
tag.Genres = Array.Empty<string> ();
168168
Assert.IsTrue (tag.IsEmpty, "Again empty");
169169
Assert.AreEqual (0, tag.Genres.Length, "Again empty");
170170

src/TaglibSharp.Tests/TaggingFormats/Id3V1Test.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void TestPerformers ()
5959
Assert.IsFalse (tag.IsEmpty, "Still not empty");
6060
Assert.AreEqual ("A123456789; B123456789; C1234567", tag.JoinedPerformers);
6161

62-
tag.Performers = new string[0];
62+
tag.Performers = Array.Empty<string> ();
6363
Assert.IsTrue (tag.IsEmpty, "Again empty");
6464
Assert.AreEqual (0, tag.Performers.Length, "Again empty");
6565

@@ -228,7 +228,7 @@ public void TestGenres ()
228228
Assert.IsTrue (tag.IsEmpty, "Still empty");
229229
Assert.AreEqual (0, tag.Genres.Length, "Still empty");
230230

231-
tag.Genres = new string[0];
231+
tag.Genres = Array.Empty<string> ();
232232
Assert.IsTrue (tag.IsEmpty, "Again empty");
233233
Assert.AreEqual (0, tag.Genres.Length, "Again empty");
234234

src/TaglibSharp.Tests/TaggingFormats/Id3V2Test.cs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using NUnit.Framework;
2+
3+
using System;
24
using System.Collections.Generic;
35
using TagLib;
46
using TagLib.Id3v2;
@@ -68,7 +70,7 @@ public void TestPerformers ()
6870
}
6971
});
7072

71-
tag.Performers = new string[0];
73+
tag.Performers = Array.Empty<string> ();
7274

7375
TagTestWithSave (ref tag, delegate (Tag t, string m) {
7476
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);
@@ -99,7 +101,7 @@ public void TestAlbumArtists ()
99101
}
100102
});
101103

102-
tag.AlbumArtists = new string[0];
104+
tag.AlbumArtists = Array.Empty<string> ();
103105

104106
TagTestWithSave (ref tag, delegate (Tag t, string m) {
105107
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);
@@ -130,7 +132,7 @@ public void TestComposers ()
130132
}
131133
});
132134

133-
tag.Composers = new string[0];
135+
tag.Composers = Array.Empty<string> ();
134136

135137
TagTestWithSave (ref tag, delegate (Tag t, string m) {
136138
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);
@@ -237,7 +239,7 @@ public void TestGenres ()
237239
}
238240
});
239241

240-
tag.Genres = new string[0];
242+
tag.Genres = Array.Empty<string> ();
241243

242244
TagTestWithSave (ref tag, delegate (Tag t, string m) {
243245
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);
@@ -567,7 +569,7 @@ public void TestPictures ()
567569
}
568570
});
569571

570-
tag.Pictures = new Picture[0];
572+
tag.Pictures = Array.Empty<Picture> ();
571573

572574
TagTestWithSave (ref tag, delegate (Tag t, string m) {
573575
Assert.IsTrue (t.IsEmpty, "Value Cleared (IsEmpty): " + m);

0 commit comments

Comments
 (0)