diff mbox series

[ovs-dev] ovsdb-idl.c: Remove meaningless MAX().

Message ID 1553147302-107422-1-git-send-email-hzhou8@ebay.com
State Accepted
Headers show
Series [ovs-dev] ovsdb-idl.c: Remove meaningless MAX(). | expand

Commit Message

Han Zhou March 21, 2019, 5:48 a.m. UTC
From: Han Zhou <hzhou8@ebay.com>

In the else condition, it is already ensured that index >= idl->min_index.
So the MAX() is confusing and misleading here.

Signed-off-by: Han Zhou <hzhou8@ebay.com>
---
 lib/ovsdb-idl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ben Pfaff March 26, 2019, 8:44 p.m. UTC | #1
On Wed, Mar 20, 2019 at 10:48:22PM -0700, Han Zhou wrote:
> From: Han Zhou <hzhou8@ebay.com>
> 
> In the else condition, it is already ensured that index >= idl->min_index.
> So the MAX() is confusing and misleading here.
> 
> Signed-off-by: Han Zhou <hzhou8@ebay.com>

Thanks, applied to master.
diff mbox series

Patch

diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 29cb80e..5ae86f7 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -1888,7 +1888,7 @@  ovsdb_idl_check_server_db(struct ovsdb_idl *idl)
             VLOG_WARN("%s: clustered database server has stale data; "
                       "trying another server", server_name);
         } else {
-            idl->min_index = MAX(idl->min_index, index);
+            idl->min_index = index;
             ok = true;
         }
     } else {