Skip to content

Commit 3768bbc

Browse files
committed
Refactor: Adjust comments in DebouncerBase and ThrottledDebouncerBase for clarity
1 parent 734cd12 commit 3768bbc

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/CodeOfChaos.Extensions/Debouncers/Regular/DebouncerBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private async Task ExecuteDebounceTaskAsync(T? capturedValue, CancellationToken
6767
}
6868
}
6969
catch (OperationCanceledException) {
70-
// Ignored: task was canceled before completion
70+
// Ignored: Task was canceled before completion
7171
}
7272
}
7373

src/CodeOfChaos.Extensions/Debouncers/Throttled/ThrottledDebouncerBase.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,11 @@ private async Task ExecuteDebounceTaskAsync(T? capturedValue, CancellationToken
7373

7474
double timeSinceReference = (taskStartTime - referenceTime).TotalMilliseconds;
7575

76-
// Execute immediately if throttling conditions are met
7776
if (timeSinceReference >= ThrottleMs) {
7877
await HandleDebounceExecution(capturedValue, externalCt, taskStartTime);
7978
return;
8079
}
8180

82-
// Wait for the debounce delay
8381
await Task.Delay(DebounceMs, _cts!.Token);
8482

8583
if (_cts.Token.IsCancellationRequested) return;
@@ -112,7 +110,6 @@ public async ValueTask DisposeAsync() {
112110

113111
await _semaphore.WaitAsync();
114112
try {
115-
// Ensure the active debounce task completes
116113
if (_debounceTask is not null) {
117114
try {
118115
await _debounceTask;

0 commit comments

Comments
 (0)