Skip to content

Commit 6dd3c46

Browse files
srawlinsCommit Queue
authored andcommitted
_http: inline local function using UI-as-code
Change-Id: I9327e85c15ea79b32dca8526d2ac4aef431da917 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415240 Reviewed-by: Ben Konyi <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]>
1 parent e85ceac commit 6dd3c46

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

sdk/lib/_http/http_impl.dart

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,6 @@ class _HttpProfileData {
132132
}
133133

134134
void startResponse({required HttpClientResponse response}) {
135-
List<Map<String, dynamic>> formatRedirectInfo() {
136-
final redirects = <Map<String, dynamic>>[];
137-
for (final redirect in response.redirects) {
138-
redirects.add({
139-
'location': redirect.location.toString(),
140-
'method': redirect.method,
141-
'statusCode': redirect.statusCode,
142-
});
143-
}
144-
return redirects;
145-
}
146-
147135
responseDetails = <String, dynamic>{
148136
'headers': formatHeaders(response.headers),
149137
'compressionState': response.compressionState.toString(),
@@ -153,7 +141,14 @@ class _HttpProfileData {
153141
'isRedirect': response.isRedirect,
154142
'persistentConnection': response.persistentConnection,
155143
'reasonPhrase': response.reasonPhrase,
156-
'redirects': formatRedirectInfo(),
144+
'redirects': [
145+
for (final redirect in response.redirects)
146+
{
147+
'location': redirect.location.toString(),
148+
'method': redirect.method,
149+
'statusCode': redirect.statusCode,
150+
},
151+
],
157152
'statusCode': response.statusCode,
158153
};
159154

0 commit comments

Comments
 (0)