Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<VersionPrefix>6.0.0</VersionPrefix>
<LangVersion>13</LangVersion>
<LangVersion>14.0</LangVersion>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory).assets\Sentry.snk</AssemblyOriginatorKeyFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal UImage(Stream stream, bool multiFileImage, bool ownsStream)
Type = (ImageType)reader.ReadByte();
Compression = (CompressionType)reader.ReadByte();
var nameAsBytes = reader.ReadBytes(32);
Name = Encoding.UTF8.GetString(nameAsBytes.Reverse().SkipWhile(x => x == 0).Reverse().ToArray());
Name = Encoding.UTF8.GetString(Enumerable.Reverse(nameAsBytes).SkipWhile(x => x == 0).Reverse().ToArray());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: other method bound with [Proposal]: First-Class Span Types

byte[] bytes = new byte[0];
_ = bytes.Reverse();

now prefers public static void Reverse<T>(this Span<T> span) in System.MemoryExtensions (if available),
rather than public static IEnumerable<TSource> Reverse<TSource>(this TSource[] source) in System.Linq.Enumerable.
Invoking the LINQ extension method explicitly instead.

See https://learn.microsoft.com/dotnet/csharp/whats-new/breaking-changes/compiler%20breaking%20changes%20-%20dotnet%2010#enumerablereverse


if (multiFileImage)
{
Expand Down
Loading