Skip to content

Commit 8665d5a

Browse files
fix: Update 19.02 (#796)
1 parent 99d6952 commit 8665d5a

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Errata.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ Zhou Jing | 22 | 1065 - 1066 | Changed 'Thread' to 'Task' and "Application exiti
4141
Zhou Jing | 4 | 161 | Fix `input < 9` to `input < 0` in Listing 4.24
4242
Zhou Jing | 4 | 119 | Show inconsistent size multi-dimensional array in listing 3.16
4343
Zhou Jing | 3 | 114 | Replace `second` with `third` in "// Retrieve third item from the end (Python)"
44-
Tyler Woody | 13 | 702 | Remove the `!` negation in `string.IsNullOrWhiteSpace(input)` in the while loop to properly allow looping
44+
Tyler Woody | 13 | 702 | Remove the `!` negation in `string.IsNullOrWhiteSpace(input)` in the while loop to properly allow looping
45+
Benjamin Michaelis | 19 | 948-949 | Add a `(` before the `next + 1` to complete the parenthesis.

src/Chapter19/Listing19.02.PollingATask.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter19.Listing19_02;
1+
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter19.Listing19_02;
22

33
#region INCLUDE
44
using System;
55
using System.Threading.Tasks;
6-
using AddisonWesley.Michaelis.EssentialCSharp.Shared;
6+
using AddisonWesley.Michaelis.EssentialCSharp.Shared; // EXCLUDE
77

88
public class Program
99
{
@@ -17,10 +17,10 @@ public static void Main()
1717
#endregion HIGHLIGHT
1818
() => PiCalculator.Calculate(100));
1919

20-
foreach(
20+
foreach (
2121
char busySymbol in Utility.BusySymbols())
2222
{
23-
if(task.IsCompleted)
23+
if (task.IsCompleted)
2424
{
2525
Console.Write('\b');
2626
break;
@@ -55,15 +55,15 @@ public static IEnumerable<char> BusySymbols()
5555
{
5656
string busySymbols = @"-\|/-\|/";
5757
int next = 0;
58-
while(true)
58+
while (true)
5959
{
6060
yield return busySymbols[next];
61-
next = next + 1) % busySymbols.Length;
61+
next = (next + 1) % busySymbols.Length;
6262
yield return '\b';
6363
}
6464
}
6565
}
66-
#region EXCLUDE
66+
#region EXCLUDE
6767
*/
6868
#endregion EXCLUDE
6969
#endregion INCLUDE

0 commit comments

Comments
 (0)