-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
optimize: paramsPlaceHolder generate by StringUtils.repeat() #2776
Conversation
paramsPlaceHolder generate by StringUtils.repeat()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unused import
Codecov Report
@@ Coverage Diff @@
## develop #2776 +/- ##
=============================================
- Coverage 50.18% 50.17% -0.01%
+ Complexity 2952 2951 -1
=============================================
Files 588 588
Lines 18938 18932 -6
Branches 2287 2285 -2
=============================================
- Hits 9504 9500 -4
Misses 8489 8489
+ Partials 945 943 -2
|
sb.append(", "); | ||
} | ||
} | ||
String paramsPlaceHolder = org.apache.commons.lang.StringUtils.repeat("?",",",statuses.length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extract repeat
method to io.seata.common.util.StringUtils?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the apache common langs
jar often conflicts with other libraries. convenient direct replacement.
xids.stream().forEach(xid -> sj.add("?")); | ||
String sql = LogStoreSqlsFactory.getLogStoreSqls(dbType).getQueryBranchTransaction(brachTable, sj.toString()); | ||
List<BranchTransactionDO> rets = new ArrayList<>(length * 3); | ||
String paramsPlaceHolder = org.apache.commons.lang.StringUtils.repeat("?",",",length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for better readability, please add a space in the separator. ","
-> ", "
@xianlaioy In addition, you need to format and standardize the pr title. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
paramsPlaceHolder generate by StringUtils.repeat()