Commit 0627dfda authored by Kristof Szabados's avatar Kristof Szabados
Browse files

minor optimization.


Signed-off-by: Kristof Szabados's avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent c9f5037a
......@@ -2186,7 +2186,7 @@ public final class RecordSetCodeGenerator {
}
for (int i = 0; i < fieldInfos.size(); ++i) {
// check field name
source.append(MessageFormat.format("if ({0} == name_len.get() && \"{1}\".equals(fld_name.substring(0,name_len.get()))) '{'\n",
source.append(MessageFormat.format("if ({0} == name_len.get() && \"{1}\".equals(fld_name.substring(0, {0}))) '{'\n",
fieldInfos.get(i).jsonAlias != null ? fieldInfos.get(i).jsonAlias.length() : fieldInfos.get(i).mDisplayName.length(),
fieldInfos.get(i).jsonAlias != null ? fieldInfos.get(i).jsonAlias : fieldInfos.get(i).mDisplayName));
if (fieldInfos.get(i).jsonDefaultValue == null) {
......
......@@ -1875,7 +1875,7 @@ public final class UnionGenerator {
for (int i = 0; i < fieldInfos.size(); i++) {
final FieldInfo fieldInfo = fieldInfos.get(i);
final String fieldName = fieldInfo.jsonAlias != null ? fieldInfo.jsonAlias : fieldInfo.mDisplayName;
source.append(MessageFormat.format("if ({0} == name_len.get() && \"{1}\".equals(fld_name.substring(0,name_len.get()))) '{'\n",
source.append(MessageFormat.format("if ({0} == name_len.get() && \"{1}\".equals(fld_name.substring(0, {0}))) '{'\n",
fieldName.length(), fieldName));
source.append(MessageFormat.format("\t\t\t\t\t\tfinal int ret_val = get_field_{0}().JSON_decode({1}_descr_, p_tok, p_silent);\n", fieldInfo.mJavaVarName, fieldInfo.mTypeDescriptorName));
source.append("\t\t\t\t\t\tif (0 > ret_val) {\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment