Skip to content

remove unnecessary get class name - #134

Closed
sergeevik wants to merge 1 commit into
dashjoin:mainfrom
sergeevik:unnecessary-class-name
Closed

sergeevik wants to merge 1 commit into
dashjoin:mainfrom
sergeevik:unnecessary-class-name

Conversation

@sergeevik

Copy link
Copy Markdown
Contributor

The class name is taken from the not null value and is not used further. It is only used to check that it exists. It does not exist for null.

@aeberhart

Copy link
Copy Markdown
Contributor

Thanks for the PR! You're right that the class names are only used for the null check, so the change is behaviorally identical.

We'll keep the current code though: evaluateEqualityExpression deliberately mirrors the original in jsonata-js (typeof lhs / typeof rhs followed by the undefined check). Staying close to the JS structure makes it easier to port upstream changes line by line, and the gain here is small.

@aeberhart aeberhart closed this Nov 9, 2026
@sergeevik

Copy link
Copy Markdown
Contributor Author

maybe mark as comment this line with description

aeberhart added a commit that referenced this pull request Nov 9, 2026
@aeberhart

Copy link
Copy Markdown
Contributor

good idea. see fcf29d3

@sergeevik

Copy link
Copy Markdown
Contributor Author

@aeberhart I meant to comment out the operations themselves. Leave them as a guide for migrating the original code, but commented out so they don't waste CPU time.

        // type checks (only used for null check, kept to mirror jsonata-js)
        //var ltype = lhs!=null ? lhs.getClass().getSimpleName() : null;
        //var rtype = rhs!=null ? rhs.getClass().getSimpleName() : null;

        if (lhs== null || rhs== null) {
            // if either side is undefined, the result is false
            return false;
        }

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

Successfully merging this pull request may close these issues.

2 participants