Optimize isConfiguration()/isIgnoringConfig() interplay 68/87268/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 25 Jan 2020 10:29:21 +0000 (11:29 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 29 Jan 2020 16:14:11 +0000 (17:14 +0100)
commitff8bb3fad1ccec25769ba465b18b393fb9fdd901
tree17f20a214dd4a40b9af0ea6be2cf11cd79de5ca7
parentb607b68104fb453235795a56bcce627c5dcd0b85
Optimize isConfiguration()/isIgnoringConfig() interplay

Now that we have coalesced these two states into a flag field,
their interplay is more apparent -- isIgnoringConfig() is always
checked before isConfiguration() and if it is set, it also implies
isConfiguration() is also set.

Using flags allows us to express this implication by simply setting
the right bits. This results in fewer flag operations performed and
a more direct dispatch between methods.

isConfiguration() is also improved to access parent.isConfiguration()
only when necessary, improving performance when a config substatement
is present.

JIRA: YANGTOOLS-652
Change-Id: Ifb18ee16e33e93de4300cc80e4ba67a9ae40bbde
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 7cb2365fa775c4b3026aa77662d34fddbda30b60)
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/StatementContextBase.java