Skip to content

Commit

Permalink
Refactor handling of lists
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmada committed May 17, 2021
1 parent 028db60 commit bd3fb7b
Show file tree
Hide file tree
Showing 55 changed files with 384 additions and 6,027 deletions.
29 changes: 2 additions & 27 deletions NetFabric.Hyperlinq.Benchmarks/Benchmarks/SelectBenchmarks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,21 +269,7 @@ public int Hyperlinq_Collection_Value()

[BenchmarkCategory("List_Value")]
[Benchmark]
public int Hyperlinq_List_Value_For()
{
var source = listValue.AsValueEnumerable().Select(item => item);
var sum = 0;
for (var index = 0; index < source.Count; index++)
{
var item = source[index];
sum += item;
}
return sum;
}

[BenchmarkCategory("List_Value")]
[Benchmark]
public int Hyperlinq_List_Value_Foreach()
public int Hyperlinq_List_Value()
{
var sum = 0;
foreach (var item in listValue.AsValueEnumerable().Select(item => item))
Expand Down Expand Up @@ -321,21 +307,10 @@ public int Hyperlinq_Collection_Reference()
return sum;
}

[BenchmarkCategory("List_Reference")]
[Benchmark]
public int Hyperlinq_List_Reference_For()
{
var source = listReference.AsValueEnumerable().Select(item => item);
var sum = 0;
for (var index = 0; index < source.Count; index++)
sum += source[index];
return sum;
}

#pragma warning disable HLQ010 // Consider using a 'for' loop instead.
[BenchmarkCategory("List_Reference")]
[Benchmark]
public int Hyperlinq_List_Reference_Foreach()
public int Hyperlinq_List_Reference()
{
var sum = 0;
foreach (var item in listReference.AsValueEnumerable().Select(item => item))
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void AsValueEnumerable_With_ValidData_Must_Succeed(int[] source)

// Assert
_ = result.Must()
.BeOfType<ValueReadOnlyListExtensions.ValueEnumerable<Wrap.ValueReadOnlyListWrapper<int>, int>>()
.BeOfType<ReadOnlyListExtensions.ValueEnumerable<Wrap.ValueReadOnlyListWrapper<int>, int>>()
.BeEnumerableOf<int>()
.BeEqualTo(wrapped);
}
Expand Down
Loading

0 comments on commit bd3fb7b

Please sign in to comment.