Skip to content
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

Unnecessary code in method "object_add_child_node"? #10

Open
fatihpense opened this issue Nov 28, 2020 · 0 comments
Open

Unnecessary code in method "object_add_child_node"? #10

fatihpense opened this issue Nov 28, 2020 · 0 comments

Comments

@fatihpense
Copy link
Owner

I add this issue from Alejandro's comment on the blog post:
https://blogs.sap.com/2016/07/03/an-open-source-abap-json-library-zclmdpjson/comment-page-1/#comment-538562


Error on this method (which doesn’t seem to have impact, maybe in performance with large data it could)

Shouldn’t the method insert only to OBJECT_CHILDREN (and not append to ARRAY_CHILDREN, which is what ARRAY_ADD_CHILD_NODE does…)?

  METHOD object_add_child_node.
    DATA : wa_array_children TYPE lcl_mdp_json_node=>typ_array_children .
    wa_array_children-node = child_node .
"IS THIS APPEND NECESSARY?
    APPEND wa_array_children TO me->array_children.
    DATA : wa_object_children TYPE  lcl_mdp_json_node=>typ_object_children .
    wa_object_children-key = child_key .
    wa_object_children-node = child_node .
    INSERT wa_object_children INTO TABLE me->object_children.
    object_node = me.
  ENDMETHOD.                    "object_add_child_node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant