Do not retain single-entry RangeSets 39/98839/4
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 3 Dec 2021 23:21:41 +0000 (00:21 +0100)
committerRobert Varga <nite@hq.sk>
Sat, 4 Dec 2021 08:15:37 +0000 (08:15 +0000)
commit01925b2a78cead093d2872d3f5cd9712a72bdd1b
treecfc759c538e5a4d5b85d94794d46761078f76e12
parent0cae248126146492448edd26e459492c9dc7182a
Do not retain single-entry RangeSets

ImmutableRangeSet with a single entry is a tad inefficient: we retain
the set and also a singleton list. Rather than doing that, store only
the single range -- reducing the number of objects we retain.

JIRA: YANGTOOLS-1376
Change-Id: I8a3b497fa4c4b8a0106136f056bb363d6e103930
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
model/yang-model-ri/src/main/java/org/opendaylight/yangtools/yang/model/ri/type/AbstractConstraint.java [new file with mode: 0644]
model/yang-model-ri/src/main/java/org/opendaylight/yangtools/yang/model/ri/type/ResolvedLengthConstraint.java
model/yang-model-ri/src/main/java/org/opendaylight/yangtools/yang/model/ri/type/ResolvedRangeConstraint.java