diff options
author | Nasser Grainawi <nasser@codeaurora.org> | 2021-05-10 15:39:30 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-05-10 15:39:30 +0000 |
commit | 13cefb724df786d254ecbc24261589ab473be267 (patch) | |
tree | 65c30de335fe3c8d5d440846eb36f3f787b39af4 | |
parent | 5774ae2eb58299465916ee1f50ca05545de8b2a0 (diff) | |
parent | cfeacabccb5c40645d9bd837768d171ab4ef1c74 (diff) |
Merge "ReplicationState: Streamline getRefStatus()"
-rw-r--r-- | src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java b/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java index 871ed52..fa65803 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java +++ b/src/main/java/com/googlesource/gerrit/plugins/replication/ReplicationState.java @@ -140,12 +140,12 @@ public class ReplicationState { } private RefReplicationStatus getRefStatus(String project, String ref) { - if (!statusByProjectRef.contains(project, ref)) { - RefReplicationStatus refStatus = new RefReplicationStatus(project, ref); + RefReplicationStatus refStatus = statusByProjectRef.get(project, ref); + if (refStatus == null) { + refStatus = new RefReplicationStatus(project, ref); statusByProjectRef.put(project, ref, refStatus); - return refStatus; } - return statusByProjectRef.get(project, ref); + return refStatus; } public void waitForReplication() throws InterruptedException { |