Skip to content

Commit

Permalink
Use var in XML doc examples for less type ceremony
Browse files Browse the repository at this point in the history
  • Loading branch information
leandromoh authored and atifaziz committed Apr 18, 2018
1 parent 6de4121 commit 85c525c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion MoreLinq/Generate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static partial class MoreEnumerable
/// </remarks>
/// <example>
/// <code><![CDATA[
/// IEnumerable<int> result = MoreEnumerable.Generate(2, n => n * n).Take(5);
/// var result = MoreEnumerable.Generate(2, n => n * n).Take(5);
/// ]]></code>
/// The <c>result</c> variable, when iterated over, will yield 2, 4, 16, 256, and 65536, in turn.
/// </example>
Expand Down
6 changes: 3 additions & 3 deletions MoreLinq/Pad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static partial class MoreEnumerable
/// <example>
/// <code><![CDATA[
/// int[] numbers = { 123, 456, 789 };
/// IEnumerable<int> result = numbers.Pad(5);
/// var result = numbers.Pad(5);
/// ]]></code>
/// The <c>result</c> variable, when iterated over, will yield
/// 123, 456, 789 and two zeroes, in turn.
Expand Down Expand Up @@ -69,7 +69,7 @@ public static IEnumerable<TSource> Pad<TSource>(this IEnumerable<TSource> source
/// <example>
/// <code><![CDATA[
/// int[] numbers = { 123, 456, 789 };
/// IEnumerable<int> result = numbers.Pad(5, -1);
/// var result = numbers.Pad(5, -1);
/// ]]></code>
/// The <c>result</c> variable, when iterated over, will yield
/// 123, 456, and 789 followed by two occurrences of -1, in turn.
Expand Down Expand Up @@ -100,7 +100,7 @@ public static IEnumerable<TSource> Pad<TSource>(this IEnumerable<TSource> source
/// <example>
/// <code><![CDATA[
/// int[] numbers = { 0, 1, 2 };
/// IEnumerable<int> result = numbers.Pad(5, i => -i);
/// var result = numbers.Pad(5, i => -i);
/// ]]></code>
/// The <c>result</c> variable, when iterated over, will yield
/// 0, 1, 2, -3 and -4, in turn.
Expand Down
2 changes: 1 addition & 1 deletion MoreLinq/Pairwise.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static partial class MoreEnumerable
/// <example>
/// <code><![CDATA[
/// int[] numbers = { 123, 456, 789 };
/// IEnumerable<int> result = numbers.Pairwise((a, b) => a + b);
/// var result = numbers.Pairwise((a, b) => a + b);
/// ]]></code>
/// The <c>result</c> variable, when iterated over, will yield
/// 579 and 1245, in turn.
Expand Down
7 changes: 3 additions & 4 deletions MoreLinq/PreScan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ static partial class MoreEnumerable
/// </remarks>
/// <example>
/// <code><![CDATA[
/// Func<int, int, int> plus = (a, b) => a + b;
/// int[] values = { 1, 2, 3, 4 };
/// IEnumerable<int> prescan = values.PreScan(plus, 0);
/// IEnumerable<int> scan = values.Scan(plus; a + b);
/// IEnumerable<int> result = values.ZipShortest(prescan, plus);
/// var prescan = values.PreScan((a, b) => a + b, 0);
/// var scan = values.Scan((a, b) => a + b);
/// var result = values.ZipShortest(prescan, plus);
/// ]]></code>
/// <c>prescan</c> will yield <c>{ 0, 1, 3, 6 }</c>, while <c>scan</c>
/// and <c>result</c> will both yield <c>{ 1, 3, 6, 10 }</c>. This
Expand Down
2 changes: 1 addition & 1 deletion MoreLinq/Prepend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static partial class MoreEnumerable
/// </remarks>
/// <code><![CDATA[
/// int[] numbers = { 1, 2, 3 };
/// IEnumerable<int> result = numbers.Prepend(0);
/// var result = numbers.Prepend(0);
/// ]]></code>
/// The <c>result</c> variable, when iterated over, will yield
/// 0, 1, 2 and 3, in turn.
Expand Down
7 changes: 3 additions & 4 deletions MoreLinq/Scan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ static partial class MoreEnumerable
/// </remarks>
/// <example>
/// <code><![CDATA[
/// Func<int, int, int> plus = (a, b) => a + b;
/// int[] values = { 1, 2, 3, 4 };
/// IEnumerable<int> prescan = values.PreScan(plus, 0);
/// IEnumerable<int> scan = values.Scan(plus; a + b);
/// IEnumerable<int> result = values.ZipShortest(prescan, plus);
/// var prescan = values.PreScan((a, b) => a + b, 0);
/// var scan = values.Scan((a, b) => a + b);
/// var result = values.ZipShortest(prescan, plus);
/// ]]></code>
/// <c>prescan</c> will yield <c>{ 0, 1, 3, 6 }</c>, while <c>scan</c>
/// and <c>result</c> will both yield <c>{ 1, 3, 6, 10 }</c>. This
Expand Down
2 changes: 1 addition & 1 deletion MoreLinq/TakeEvery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static partial class MoreEnumerable
/// <example>
/// <code><![CDATA[
/// int[] numbers = { 1, 2, 3, 4, 5 };
/// IEnumerable<int> result = numbers.TakeEvery(2);
/// var result = numbers.TakeEvery(2);
/// ]]></code>
/// The <c>result</c> variable, when iterated over, will yield 1, 3 and 5, in turn.
/// </example>
Expand Down
2 changes: 1 addition & 1 deletion MoreLinq/TakeLast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static partial class MoreEnumerable
/// <example>
/// <code><![CDATA[
/// int[] numbers = { 12, 34, 56, 78 };
/// IEnumerable<int> result = numbers.TakeLast(2);
/// var result = numbers.TakeLast(2);
/// ]]></code>
/// The <c>result</c> variable, when iterated over, will yield
/// 56 and 78 in turn.
Expand Down

0 comments on commit 85c525c

Please sign in to comment.