Do not force materialization when not needed 54/94654/10
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 18 Jan 2021 06:56:56 +0000 (07:56 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 18 Jan 2021 21:23:50 +0000 (22:23 +0100)
When an InferredStatementContext was not forced to materialize
during inference, i.e. there was no movement in its substatements,
we can potentially reuse the same EffectiveStatement instance.

Refactor applyCopyPolicy() to provide the statement-specific
facility to decide which way the semantics goes. Based on this
feedback, the InferredStatementContext is improved to skip
instantiations when instructed to do so by the support.

AbstractStatementSupport is retrofitted to provide this functionality
through EffectiveComparator and its subclasses. Backwards compatibility
is maintained via choosing a conservative comparator based on
copy policy.

KeyStatementSupport is converted to take advantage of these
facilities.

JIRA: YANGTOOLS-1195
Change-Id: Idcea43f5ee121598eba324bac2a2edc70b11eaaa
Signed-off-by: miroslav.kovac <miroslav.kovac@pantheon.tech>
Signed-off-by: Michal Banik <michal.banik@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>

No differences found