Skip to content

Commit 4a7689d

Browse files
committed
warnings, again
1 parent f5cfcb0 commit 4a7689d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/csharp/whats-new/tutorials/compound-assignment-operators.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ C# supports the existing expansion, but it uses it only when a compound user def
3131
In this tutorial, you:
3232

3333
> [!div class="checklist"]
34-
>
34+
>
3535
> * Install prerequisites
3636
> * Analyze the starting sample
3737
> * Implement compound assignment operators
@@ -94,7 +94,7 @@ Examine the starter `GateAttendance` record class:
9494

9595
The `InitialImplementation.GateAttendance` record demonstrates the traditional approach to operator overloading in C#. Notice how both the increment operator (`++`) and addition operator (`+`) create entirely new instances of `GateAttendance` using the `with` expression. Each time you write `gate++` or `gate += partySize`, the operators allocate a new record instance with the updated `Count` value, then return that new instance. While this approach maintains immutability and thread safety, it comes at the cost of frequent memory allocations. In scenarios with many operations—like our concert simulation with hundreds of attendance updates—these allocations accumulate quickly, potentially impacting performance and increasing garbage collection pressure.
9696

97-
To see this allocation behavior in action, try running the [.NET Object Allocation tracking tool](~/visualstudio/profiling/dotnet-alloc-tool) in Visual Studio. When you profile the current implementation during the concert simulation, you discover that it allocates 134 `GateAttendance` objects to complete the relatively small simulation. Each operator call creates a new instance, demonstrating how quickly allocations can accumulate in real-world scenarios. This measurement provides a concrete baseline for comparing the performance improvements you achieve with compound assignment operators.
97+
To see this allocation behavior in action, try running the [.NET Object Allocation tracking tool](/visualstudio/profiling/dotnet-alloc-tool) in Visual Studio. When you profile the current implementation during the concert simulation, you discover that it allocates 134 `GateAttendance` objects to complete the relatively small simulation. Each operator call creates a new instance, demonstrating how quickly allocations can accumulate in real-world scenarios. This measurement provides a concrete baseline for comparing the performance improvements you achieve with compound assignment operators.
9898

9999
## Implement compound assignment operators
100100

0 commit comments

Comments
 (0)