Improve LocalProxyTransaction.doExists() 56/100656/1
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 19 Apr 2022 20:50:22 +0000 (22:50 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 19 Apr 2022 20:50:22 +0000 (22:50 +0200)
We can use immediateBooleanFluentFuture() and skip allocating two
objects.

Change-Id: I11747ddef4fa8e3dbf950b5e1879d2e1ccc395ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/LocalProxyTransaction.java

index 662ccba..cc09265 100644 (file)
@@ -77,7 +77,7 @@ abstract class LocalProxyTransaction extends AbstractProxyTransaction {
 
     @Override
     final FluentFuture<Boolean> doExists(final YangInstanceIdentifier path) {
 
     @Override
     final FluentFuture<Boolean> doExists(final YangInstanceIdentifier path) {
-        return FluentFutures.immediateFluentFuture(readOnlyView().readNode(path).isPresent());
+        return FluentFutures.immediateBooleanFluentFuture(readOnlyView().readNode(path).isPresent());
     }
 
     @Override
     }
 
     @Override