 | CondensedCollectionExtensionsSum Method (CondensedCollectionInt32) |
[This is preliminary documentation and is subject to change.]
Computes the sum of a sequence of Int32 values. Optimized for a CondensedCollection.
Namespace:
Condensed.Linq
Assembly:
Condensed (in Condensed.dll) Version: 0.1.0.0 (0.1.0.0)
Syntaxpublic static int Sum(
this CondensedCollection<int> source
)
<ExtensionAttribute>
Public Shared Function Sum (
source As CondensedCollection(Of Integer)
) As Integer
public:
[ExtensionAttribute]
static int Sum(
CondensedCollection<int>^ source
)
[<ExtensionAttribute>]
static member Sum :
source : CondensedCollection<int> -> int
Parameters
- source
- Type: CondensedCondensedCollectionInt32
A CondensedCollection of Int32 values to calculate the sum of.
Return Value
Type:
Int32The sum of the sequence of values.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
CondensedCollectionInt32. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Exceptions
Remarks
This implementation of Sum() is specialized for a CondensedCollection and tries to
take advantage of the CondensedCollection's knowledge of unique values in order to improve performance.
If you would rather use the normal LINQ extension method then cast the CondensedCollection to an
IListT
to use the
Sum(IEnumerableInt32) implementation.
See Also