Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Commit 25cb1aa

Browse files
committed
Reuse the same tag separator array
We're targeting netstandard2.0 and don't have ReadOnlySpan or any of the new APIs that avoid allocating
1 parent 3550ded commit 25cb1aa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Xwt/Xwt.Drawing/Image.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,7 @@ class ImageTagSet
973973
string[] tagsArray;
974974

975975
public static readonly ImageTagSet Empty = new ImageTagSet (new string[0]);
976+
static readonly char[] tagSeparators = { '~' };
976977

977978
public ImageTagSet (string [] tagsArray)
978979
{
@@ -988,7 +989,7 @@ public bool IsEmpty {
988989

989990
public ImageTagSet (string tags)
990991
{
991-
tagsArray = tags.Split (new [] { '~' }, StringSplitOptions.RemoveEmptyEntries);
992+
tagsArray = tags.Split (tagSeparators, StringSplitOptions.RemoveEmptyEntries);
992993
Array.Sort (AsArray);
993994
}
994995

0 commit comments

Comments
 (0)