Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Hathcock committed Apr 23, 2024
1 parent e4d5b56 commit 5d9c995
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/SharpCompress/Common/Rar/Headers/FileHeader.cs
Expand Up @@ -344,11 +344,11 @@ private void ReadFromReaderV4(MarkingBinaryReader reader)
if (FileLastModifiedTime is not null)
{
FileLastModifiedTime = ProcessExtendedTimeV4(
extendedFlags,
FileLastModifiedTime,
reader,
0
);
extendedFlags,
FileLastModifiedTime,
reader,
0
);
}

FileCreatedTime = ProcessExtendedTimeV4(extendedFlags, null, reader, 1);
Expand Down
9 changes: 7 additions & 2 deletions src/SharpCompress/Common/Rar/Headers/RarHeaderFactory.cs
Expand Up @@ -158,9 +158,14 @@ public IEnumerable<IRarHeader> ReadHeaders(Stream stream)
{
fh.PackedStream = new RarCryptoWrapper(
ms,
fh.R4Salt is null ? fh.Rar5CryptoInfo.NotNull().Salt : fh.R4Salt,
fh.R4Salt is null
? new CryptKey5(Options.Password, fh.Rar5CryptoInfo.NotNull())
? fh.Rar5CryptoInfo.NotNull().Salt
: fh.R4Salt,
fh.R4Salt is null
? new CryptKey5(
Options.Password,
fh.Rar5CryptoInfo.NotNull()
)
: new CryptKey3(Options.Password)
);
}
Expand Down
5 changes: 3 additions & 2 deletions src/SharpCompress/NotNullExtensions.cs
Expand Up @@ -11,6 +11,7 @@ public static class NotNullExtensions
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static IEnumerable<T> Empty<T>(this IEnumerable<T>? source) =>
source ?? Enumerable.Empty<T>();

[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static IEnumerable<T> Empty<T>(this T? source)
{
Expand All @@ -22,7 +23,7 @@ public static IEnumerable<T> Empty<T>(this T? source)
}

#if NETFRAMEWORK || NETSTANDARD
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static T NotNull<T>(this T? obj, string? message = null)
where T : class
{
Expand All @@ -33,7 +34,7 @@ public static T NotNull<T>(this T? obj, string? message = null)
return obj;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static T NotNull<T>(this T? obj, string? message = null)
where T : struct
{
Expand Down
3 changes: 2 additions & 1 deletion src/SharpCompress/Readers/AbstractReader.cs
Expand Up @@ -192,7 +192,8 @@ public EntryStream OpenEntryStream()
/// <summary>
/// Retains a reference to the entry stream, so we can check whether it completed later.
/// </summary>
protected EntryStream CreateEntryStream(Stream? decompressed) => new(this, decompressed.NotNull());
protected EntryStream CreateEntryStream(Stream? decompressed) =>
new(this, decompressed.NotNull());

protected virtual EntryStream GetEntryStream() =>
CreateEntryStream(Entry.Parts.First().GetCompressedStream());
Expand Down

0 comments on commit 5d9c995

Please sign in to comment.