Skip to content
This repository was archived by the owner on Jul 8, 2024. It is now read-only.

Fix duplicate evaluation of scalar expressions #174

Merged
merged 2 commits into from
Dec 23, 2021

Conversation

JoostSchipperheijn
Copy link
Contributor

Hi Firely,

I noticed that scalar expressions are evaluated twice in the current implementation.
This has a performance penalty and can cause problems for custom functions that maintain state.

I fixed the problem and added a unit test to validate it.
The take(2) call composes the minimal number of objects
required to determine whether the evaluation has 0, 1 or more results.

Can you have a look?

Thanks -- Joost Schipperheijn

@marcovisserFurore marcovisserFurore added the enhancement New feature or request label Dec 21, 2021
@marcovisserFurore
Copy link
Member

Thanks @JoostSchipperheijn. We will investigate this. I've already run the FhirPath tests for R4, and they succeeded as well with your solution.

@ewoutkramer ewoutkramer self-assigned this Dec 23, 2021
@ewoutkramer ewoutkramer added bug Something isn't working and removed enhancement New feature or request labels Dec 23, 2021
@ewoutkramer ewoutkramer self-requested a review December 23, 2021 09:16
Copy link
Member

@ewoutkramer ewoutkramer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @JoostSchipperheijn - nice unit test!

@ewoutkramer ewoutkramer merged commit 9fc7b98 into FirelyTeam:develop Dec 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants