commit | 85355c4bf10d466d732a7b054cc37fc6b0c9d79e | [log] [tgz] |
---|---|---|
author | Jian Li <pyguni@gmail.com> | Fri May 12 03:08:01 2017 +0900 |
committer | Jian Li <pyguni@gmail.com> | Mon May 15 18:20:46 2017 +0000 |
tree | 2ef19ba55daaf2e38607ad6b3cae030f0b8057c0 | |
parent | 9e04379a875136a54cfb8ccfdb7f7434858dfae4 [diff] |
Further improve MapDB query performance with reduced number of get Change-Id: I4026215d23bf9e1ea064f0d19cd853f9813c3005
diff --git a/protocols/lisp/ctl/src/main/java/org/onosproject/lisp/ctl/impl/LispMappingDatabase.java b/protocols/lisp/ctl/src/main/java/org/onosproject/lisp/ctl/impl/LispMappingDatabase.java index 9aec8e9..8878349 100644 --- a/protocols/lisp/ctl/src/main/java/org/onosproject/lisp/ctl/impl/LispMappingDatabase.java +++ b/protocols/lisp/ctl/src/main/java/org/onosproject/lisp/ctl/impl/LispMappingDatabase.java
@@ -113,9 +113,11 @@ public LispMapRecord getMapRecordByEidRecord(LispEidRecord eid, boolean proxyMapReply) { for (LispEidRecord key : map.keySet()) { - if (isInRange(key, eid) && map.get(key) != null - && map.get(key).isProxyMapReply() == proxyMapReply) { - return map.get(key).getMapRecord(); + if (isInRange(key, eid)) { + LispProxyMapRecord record = map.get(key); + if (record != null && record.isProxyMapReply() == proxyMapReply) { + return record.getMapRecord(); + } } }