Skip to content

Commit

Permalink
Update 19.02
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminMichaelis committed Nov 29, 2024
1 parent 99d6952 commit 83f1c04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Errata.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ Zhou Jing | 22 | 1065 - 1066 | Changed 'Thread' to 'Task' and "Application exiti
Zhou Jing | 4 | 161 | Fix `input < 9` to `input < 0` in Listing 4.24
Zhou Jing | 4 | 119 | Show inconsistent size multi-dimensional array in listing 3.16
Zhou Jing | 3 | 114 | Replace `second` with `third` in "// Retrieve third item from the end (Python)"
Tyler Woody | 13 | 702 | Remove the `!` negation in `string.IsNullOrWhiteSpace(input)` in the while loop to properly allow looping
Tyler Woody | 13 | 702 | Remove the `!` negation in `string.IsNullOrWhiteSpace(input)` in the while loop to properly allow looping
Benjamin Michaelis | 19 | .. | Add a `(` before the `next + 1` to complete the parenthesis.
14 changes: 7 additions & 7 deletions src/Chapter19/Listing19.02.PollingATask.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter19.Listing19_02;
namespace AddisonWesley.Michaelis.EssentialCSharp.Chapter19.Listing19_02;

#region INCLUDE
using System;
using System.Threading.Tasks;
using AddisonWesley.Michaelis.EssentialCSharp.Shared;
using AddisonWesley.Michaelis.EssentialCSharp.Shared; // EXCLUDE

public class Program
{
Expand All @@ -17,10 +17,10 @@ public static void Main()
#endregion HIGHLIGHT
() => PiCalculator.Calculate(100));

foreach(
foreach (
char busySymbol in Utility.BusySymbols())
{
if(task.IsCompleted)
if (task.IsCompleted)
{
Console.Write('\b');
break;
Expand Down Expand Up @@ -55,15 +55,15 @@ public static IEnumerable<char> BusySymbols()
{
string busySymbols = @"-\|/-\|/";
int next = 0;
while(true)
while (true)
{
yield return busySymbols[next];
next = next + 1) % busySymbols.Length;
next = (next + 1) % busySymbols.Length;
yield return '\b';
}
}
}
#region EXCLUDE
#region EXCLUDE
*/
#endregion EXCLUDE
#endregion INCLUDE

0 comments on commit 83f1c04

Please sign in to comment.