diff options
author | Smokowski, Kevin (ks6305) <kevin.smokowski@att.com> | 2019-05-31 18:58:41 +0000 |
---|---|---|
committer | Smokowski, Kevin (ks6305) <kevin.smokowski@att.com> | 2019-05-31 18:58:41 +0000 |
commit | 2f7123a54f1528b20a19d57bae146e01c0499a58 (patch) | |
tree | 84a7eff313f42788ee2cb39dfa24721192ba4301 | |
parent | 0070f68e9369828cc03b17938fb927eccb8227ac (diff) |
Mdsalhelper toBuilder performance issue
Mdsalhelper toBuilder performance issue, no impact
Change-Id: I2788352b0f25f970380f15653008026f8a12a233
Issue-ID: CCSDK-1374
Signed-off-by: Smokowski, Kevin (ks6305) <kevin.smokowski@att.com>
-rwxr-xr-x | sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java index 4d17f8730..0300236f7 100755 --- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java +++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/MdsalHelper.java @@ -401,7 +401,7 @@ public class MdsalHelper { LOG.trace("Saving properties to List<" + elemType.getName() + "> from " + pfx); - if (props.contains(pfx + "_length")) { + if (props.containsKey(pfx + "_length")) { try { int listLength = Integer.parseInt(props.getProperty(pfx + "_length")); @@ -413,18 +413,19 @@ public class MdsalHelper { } } + String arrayKey = pfx + "["; + int arrayKeyLength = arrayKey.length(); if (maxIdx == -1) { // Figure out array size for (Object pNameObj : props.keySet()) { String key = (String) pNameObj; - if (key.startsWith(pfx + "[")) { - String idxStr = key.substring(pfx.length() + 1); + if (key.startsWith(arrayKey)) { + String idxStr = key.substring(arrayKeyLength); int endloc = idxStr.indexOf("]"); if (endloc != -1) { idxStr = idxStr.substring(0, endloc); } - try { int curIdx = Integer.parseInt(idxStr); if (curIdx > maxIdx) { |