Skip to content

Commit

Permalink
portmap: don't use Boolean object when primitive is required
Browse files Browse the repository at this point in the history
Acked-by: Paul Millar
Target: master
  • Loading branch information
kofemann committed Feb 3, 2020
1 parent c66adbf commit 22fdabb
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,15 @@ private void processV2Call(RpcCall call) throws OncRpcException, IOException {
netid.toString(newMapping.getPort()),
SERVICE_OWNER_UNSPECIFIED
);
Boolean found = false;
boolean found = false;
synchronized(_services) {
for ( rpcb c : _services ) {
if ( c.getProg() == rpcbMapping.getProg() && c.getVers() == rpcbMapping.getVers() && c.getNetid().equals(rpcbMapping.getNetid()) ) {
found = true;
break;
}
}
if ( found == false) { // only add if not found already
if (!found) { // only add if not found already
_services.add(rpcbMapping);
}
}
Expand All @@ -112,7 +113,7 @@ private void processV2Call(RpcCall call) throws OncRpcException, IOException {
netid.toString(unsetMapping.getPort()),
getOwner(call)
);
Boolean removed = false;
boolean removed = false;
synchronized(_services) {
Set<rpcb> target = new HashSet<>();
// lookup entries
Expand Down

0 comments on commit 22fdabb

Please sign in to comment.