Skip to content

Commit

Permalink
Rename TOther to TResult
Browse files Browse the repository at this point in the history
  • Loading branch information
andreise committed Jan 11, 2024
1 parent 3ecd2db commit 86514a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
partial struct FlatArray<T>
{
// TODO: Add the tests and make public
internal FlatArray<TOther>? TryCastArray<TOther>()
internal FlatArray<TResult>? TryCastArray<TResult>()
{
// Safe array cast: 'as' cast

if (InnerItems() is not TOther[] otherItems)
if (InnerItems() is not TResult[] resultItems)
{
return null;
}

var otherItemsNormalized = items is null ? null : otherItems;
var resultItemsNormalized = items is null ? null : resultItems;

return new(length, otherItemsNormalized, default);
return new(length, resultItemsNormalized, default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
partial struct FlatArray<T>
{
// TODO: Add the tests and make public
internal FlatArray<TOther> CastArray<TOther>()
internal FlatArray<TResult> CastArray<TResult>()
{
// Unsafe array cast: InvalidCastException is expected

var otherItems = (TOther[])(object)InnerItems();
var resultItems = (TResult[])(object)InnerItems();

var otherItemsNormalized = items is null ? null : otherItems;
var resultItemsNormalized = items is null ? null : resultItems;

return new(length, otherItemsNormalized, default);
return new(length, resultItemsNormalized, default);
}
}

0 comments on commit 86514a1

Please sign in to comment.