Skip to content

Commit ee63fc9

Browse files
committed
refactor: Simplify httpClient conditional logic using ternary operator
1 parent b36c5b8 commit ee63fc9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

packages/storage_client/lib/src/fetch.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ class Fetch {
8282

8383
_log.finest('Request: $method $url $headers');
8484
final http.StreamedResponse streamedResponse;
85-
if (httpClient != null) {
86-
streamedResponse = await httpClient!.send(request);
87-
} else {
88-
streamedResponse = await request.send();
89-
}
85+
// if (httpClient != null) {
86+
// streamedResponse = await httpClient!.send(request);
87+
// } else {
88+
// streamedResponse = await request.send();
89+
// }
90+
streamedResponse = httpClient != null
91+
? await httpClient!.send(request)
92+
: await request.send();
93+
9094
return _handleResponse(streamedResponse, options);
9195
}
9296

0 commit comments

Comments
 (0)