Skip to content

Commit 95bda8f

Browse files
authored
Remove redundant switchIfEmptyStage (#1455)
1 parent 6098bce commit 95bda8f

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/internal/OperationExecutorImpl.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ public <T> Mono<T> execute(final AsyncReadOperation<T> operation, final ReadPref
8484
clientSessionHelper.withClientSession(session, this)
8585
.map(clientSession -> getReadWriteBinding(getContext(subscriber),
8686
readPreference, readConcern, clientSession, session == null))
87-
// TODO (CSOT) - does this get called - can the above return empty?
88-
.switchIfEmpty(Mono.fromCallable(() ->
89-
getReadWriteBinding(getContext(subscriber),
90-
readPreference, readConcern, session, false)))
9187
.flatMap(binding -> {
9288
if (session != null && session.hasActiveTransaction() && !binding.getReadPreference().equals(primary())) {
9389
binding.release();
@@ -122,10 +118,6 @@ public <T> Mono<T> execute(final AsyncWriteOperation<T> operation, final ReadCon
122118
clientSessionHelper.withClientSession(session, this)
123119
.map(clientSession -> getReadWriteBinding(getContext(subscriber),
124120
primary(), readConcern, clientSession, session == null))
125-
// TODO (CSOT) - does this get called - can the above return empty?
126-
.switchIfEmpty(Mono.fromCallable(() ->
127-
getReadWriteBinding(getContext(subscriber), primary(),
128-
readConcern, session, false)))
129121
.flatMap(binding ->
130122
Mono.<T>create(sink -> operation.executeAsync(binding, (result, t) -> {
131123
try {

0 commit comments

Comments
 (0)