imbajin commented on code in PR #1924:
URL: 
https://github.com/apache/incubator-hugegraph/pull/1924#discussion_r917252837


##########
hugegraph-mysql/src/main/java/com/baidu/hugegraph/backend/store/mysql/MysqlTable.java:
##########
@@ -286,25 +286,22 @@ protected List<Object> 
buildColumnsParams(MysqlBackendEntry.Row entry,
     }
 
     protected String buildUpdateIfPresentTemplate(MysqlBackendEntry.Row entry) 
{
-
         StringBuilder update = new StringBuilder();
         update.append("UPDATE ").append(this.table());
         update.append(" SET ");
 
         List<HugeKeys> idNames = this.idColumnName();
 
         int i = 0;
-        int size = entry.columns().size();
         for (HugeKeys key : entry.columns().keySet()) {
             if (idNames.contains(key)) {
-                size--;
                 continue;
             }
-            update.append(formatKey(key));
-            update.append("=?");
-            if (++i != size) {
+            if (i++ > 0) {
                 update.append(", ");
             }
+            update.append(formatKey(key));
+            update.append("=?");

Review Comment:
   could add a uri example to diff the logic



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to