optimizations

This commit is contained in:
mertalev
2025-07-30 19:30:42 -04:00
parent 196f2a72f4
commit 6cea779b2d
23 changed files with 7004 additions and 329 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ class AsyncMutex {
Future _running = Future.value(null);
int _enqueued = 0;
get enqueued => _enqueued;
int get enqueued => _enqueued;
/// Execute [operation] exclusively, after any currently running operations.
/// Returns a [Future] with the result of the [operation].
+3 -2
View File
@@ -27,8 +27,9 @@ class Debouncer {
}
Future<void>? drain() {
if (_timer != null && _timer!.isActive) {
_timer!.cancel();
final timer = _timer;
if (timer != null && timer.isActive) {
timer.cancel();
if (_lastAction != null) {
_callAndRest();
}