Simplify Uint range checks 77/84477/1
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 15 Sep 2019 17:48:10 +0000 (19:48 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sun, 15 Sep 2019 17:55:51 +0000 (19:55 +0200)
commit85eb84d99eeda92efe67b67b6cfbfafb92f5ae3d
treecf07974d7e12bf20f968228bcb29a2a4bb575dc2
parent12981cbad22d548a91b1fc7fc5297d0c85905fec
Simplify Uint range checks

This saves a single instruction (and a stack slot) in the hot path,
while penalizing exceptional path, by not giving it the constant
string.

As exceptions are expected to be (relatively) rare, this should not
hurt much and if for some reason it does, we can always revert.

Change-Id: Ibd926732f49b0d0692f0c894166f4427a49d7f7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Uint16.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Uint32.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/Uint8.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/UintConversions.java