Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit c49b2382 authored by Harald Martini's avatar Harald Martini
Browse files

added DebuggerStepThrough Attribute to some enumerable extension methods

parent 18203eb0
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using TUGraz.VectoCommon.Models; using TUGraz.VectoCommon.Models;
...@@ -156,15 +157,17 @@ namespace TUGraz.VectoCommon.Utils ...@@ -156,15 +157,17 @@ namespace TUGraz.VectoCommon.Utils
} }
} }
} }
[DebuggerStepThrough]
public static T Sum<T>(this IEnumerable<T> values) where T : SIBase<T> => public static T Sum<T>(this IEnumerable<T> values) where T : SIBase<T> =>
values.Sum(x => x); values.Sum(x => x);
public static TResult Sum<TU, TResult>(this IEnumerable<TU> values, Func<TU, TResult> selector) [DebuggerStepThrough]
public static TResult Sum<TU, TResult>(this IEnumerable<TU> values, Func<TU, TResult> selector)
where TResult : SIBase<TResult> => where TResult : SIBase<TResult> =>
values.Select(selector).DefaultIfEmpty().Aggregate((sum, current) => sum + current); values.Select(selector).DefaultIfEmpty().Aggregate((sum, current) => sum + current);
public static T Average<T>(this IEnumerable<T> values) where T : SIBase<T> => [DebuggerStepThrough]
public static T Average<T>(this IEnumerable<T> values) where T : SIBase<T> =>
values.Average(v => v.Value()).SI<T>(); values.Average(v => v.Value()).SI<T>();
/// <summary> /// <summary>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment