Add QName.hashCode() cache 37/40337/6
authorRobert Varga <rovarga@cisco.com>
Tue, 14 Jun 2016 23:40:39 +0000 (01:40 +0200)
committerTony Tkacik <ttkacik@cisco.com>
Tue, 21 Jun 2016 11:46:28 +0000 (11:46 +0000)
commitb35394fa2a8a7533b062e8a040a25dc408281599
treebb103f601947e740f310bcd791559fc778747a5f
parent9537d6c25b29bc9e22bcd8232bdfced94e4fdc3b
Add QName.hashCode() cache

QName is usually involved in hash-based lookups, hence it is
useful to reuse a computed hash code so that constants do not
spend cycles on computing it more than once.

Add a field which will be lazily initiated to contain the result
of hashCode(). This has no impact on memory footprint.

Change-Id: I8a0b89599ed1029e2c572535826c52b4b837e265
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/QName.java