Skip to content

Commit

Permalink
Merge pull request #27 from dotnet-campus/t/lindexi/Pick20231225
Browse files Browse the repository at this point in the history
Pick 2023.12.25
  • Loading branch information
lindexi authored Dec 25, 2023
2 parents e2455ff + 26c6713 commit 827c456
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1867,23 +1867,22 @@ Uri imageUri
)
{
//Extract file extension without '.'
String path = imageUri.OriginalString;
ReadOnlySpan<char> extension = Path.GetExtension(path).ToLower(CultureInfo.InvariantCulture).AsSpan(1);

ReadOnlySpan<char> path = imageUri.OriginalString.AsSpan();
ReadOnlySpan<char> extension = Path.GetExtension(path).Slice(1);
ContentType contentType;
if (extension.Equals(XpsS0Markup.JpgExtension, StringComparison.Ordinal))
if (extension.Equals(XpsS0Markup.JpgExtension, StringComparison.OrdinalIgnoreCase))
{
contentType = XpsS0Markup.JpgContentType;
contentType = XpsS0Markup.JpgContentType;
}
else if (extension.Equals(XpsS0Markup.PngExtension, StringComparison.Ordinal))
else if (extension.Equals(XpsS0Markup.PngExtension, StringComparison.OrdinalIgnoreCase))
{
contentType = XpsS0Markup.PngContentType;
}
else if (extension.Equals(XpsS0Markup.TifExtension, StringComparison.Ordinal))
else if (extension.Equals(XpsS0Markup.TifExtension, StringComparison.OrdinalIgnoreCase))
{
contentType = XpsS0Markup.TifContentType;
}
else if (extension.Equals(XpsS0Markup.WdpExtension, StringComparison.Ordinal))
else if (extension.Equals(XpsS0Markup.WdpExtension, StringComparison.OrdinalIgnoreCase))
{
contentType = XpsS0Markup.WdpContentType;
}
Expand All @@ -1892,9 +1891,8 @@ Uri imageUri
//default to PNG
contentType = XpsS0Markup.PngContentType;
}

return contentType;
}
}


/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ namespace System.Xaml.Schema
public class XamlTypeInvoker
{
private static XamlTypeInvoker s_Unknown;
private static object[] s_emptyObjectArray = Array.Empty<object>();

private Dictionary<XamlType, MethodInfo> _addMethods;
internal MethodInfo EnumeratorMethod { get; set; }
Expand Down Expand Up @@ -226,7 +225,7 @@ public virtual IEnumerator GetItems(object instance)
throw new NotSupportedException(SR.Get(SRID.OnlySupportedOnCollectionsAndDictionaries));
}
MethodInfo getEnumMethod = GetEnumeratorMethod();
return (IEnumerator)SafeReflectionInvoker.InvokeMethod(getEnumMethod, instance, s_emptyObjectArray);
return (IEnumerator)SafeReflectionInvoker.InvokeMethod(getEnumMethod, instance, Array.Empty<object>());
}

// vvvvv---- Unused members. Servicing policy is to retain these anyway. -----vvvvv
Expand Down

0 comments on commit 827c456

Please sign in to comment.