-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing return to fix analysis #62
Conversation
lib/src/async_queue.dart
Outdated
@@ -59,12 +59,13 @@ class AsyncQueue<T> { | |||
/// the process was cancelled. | |||
Future _processNextItem() { | |||
var item = _items.removeFirst(); | |||
return _processor(item).then((_) { | |||
return _processor(item).then((_) async { | |||
if (_items.isNotEmpty) return _processNextItem(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the method is async
, this should be return await
. Otherwise it's easy to accidentally refactor without realizing this is asynchronous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
lib/src/async_queue.dart
Outdated
if (_items.isNotEmpty) return _processNextItem(); | ||
|
||
// We have drained the queue, stop processing and wait until something | ||
// has been enqueued. | ||
_isProcessing = false; | ||
return await null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the other return
should be return await
. There's no use in awaiting null
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed that, fixed.
* Add missing return to fix analysis * address comment * Update async_queue.dart
Tested with bleeding edge.