Skip to content

Commit

Permalink
Minor refactor Optional InnerOrDefault impl.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreise committed Jan 11, 2025
1 parent 935ad33 commit ed5cb41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ namespace System;

partial struct Optional<T>
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private T? InnerOrDefault()
=>
value;
private T? InnerOrDefault
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get => value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ partial struct Optional<T>
{
public T? OrDefault()
=>
InnerOrDefault();
InnerOrDefault;
}

0 comments on commit ed5cb41

Please sign in to comment.