weizhouapache commented on a change in pull request #3275: [CLOUDSTACK-10408]
Fix String.replaceAll() to replace() for better performance
URL: https://github.com/apache/cloudstack/pull/3275#discussion_r372873390
##########
File path:
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
##########
@@ -2951,7 +2951,7 @@ public String rebootVM(final Connect conn, final String
vmName) {
final int vnetId =
Integer.parseInt(nic.getBrName().replaceFirst("cloudVirBr", ""));
final String pifName = getPif(_guestBridgeName);
final String newBrName = "br" + pifName + "-" + vnetId;
- vmDef = vmDef.replaceAll("'" + nic.getBrName() + "'",
"'" + newBrName + "'");
+ vmDef = vmDef.replace("'" + nic.getBrName() + "'", "'"
+ newBrName + "'");
Review comment:
looks good.
maybe nobody is still using old style bridge name "cloudVirBrXXX".
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services