ovsdb: avoid unnecessary call to ovsdb_monitor_get_update()
[cascardo/ovs.git] / ovsdb / jsonrpc-server.c
index 0f7932e..5983770 100644 (file)
@@ -1294,7 +1294,11 @@ static struct json *
 ovsdb_jsonrpc_monitor_compose_update(struct ovsdb_jsonrpc_monitor *m,
                                      bool initial)
 {
-    return ovsdb_monitor_compose_update(m->dbmon, initial, &m->unflushed);
+    if (!ovsdb_monitor_needs_flush(m->dbmon, m->unflushed)) {
+        return NULL;
+    }
+
+    return ovsdb_monitor_get_update(m->dbmon, initial, &m->unflushed);
 }
 
 static bool