Skip to content

Commit 2a0e64d

Browse files
committed
Null-conditional operator goodness
1 parent 48acf7c commit 2a0e64d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Elasticsearch.Net/Transport/Transport.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ public ElasticsearchResponse<TReturn> Request<TReturn>(HttpMethod method, string
101101
if (response == null || !response.Success)
102102
pipeline.BadResponse(ref response, requestData, seenExceptions);
103103

104-
if (this.Settings.OnRequestCompleted != null)
105-
this.Settings.OnRequestCompleted(response);
104+
this.Settings.OnRequestCompleted?.Invoke(response);
106105

107106
return response;
108107
}
@@ -162,8 +161,7 @@ public async Task<ElasticsearchResponse<TReturn>> RequestAsync<TReturn>(HttpMeth
162161
if (response == null || !response.Success)
163162
pipeline.BadResponse(ref response, requestData, seenExceptions);
164163

165-
if (this.Settings.OnRequestCompleted != null)
166-
this.Settings.OnRequestCompleted(response);
164+
this.Settings.OnRequestCompleted?.Invoke(response);
167165

168166
return response;
169167
}

0 commit comments

Comments
 (0)