Committed by
Ray Milkey
Duplicate Null Check not required
Change-Id: I31e3702b1456b8c5b50bf8e139833bd5f818df6d
Showing
1 changed file
with
0 additions
and
4 deletions
... | @@ -144,7 +144,6 @@ public class SubnetManager implements SubnetService { | ... | @@ -144,7 +144,6 @@ public class SubnetManager implements SubnetService { |
144 | @Override | 144 | @Override |
145 | public boolean updateSubnets(Iterable<Subnet> subnets) { | 145 | public boolean updateSubnets(Iterable<Subnet> subnets) { |
146 | checkNotNull(subnets, SUBNET_NOT_NULL); | 146 | checkNotNull(subnets, SUBNET_NOT_NULL); |
147 | - if (subnets != null) { | ||
148 | for (Subnet subnet : subnets) { | 147 | for (Subnet subnet : subnets) { |
149 | if (!subnetStore.containsKey(subnet.id())) { | 148 | if (!subnetStore.containsKey(subnet.id())) { |
150 | log.debug("The subnet is not exist whose identifier is {}", | 149 | log.debug("The subnet is not exist whose identifier is {}", |
... | @@ -160,14 +159,12 @@ public class SubnetManager implements SubnetService { | ... | @@ -160,14 +159,12 @@ public class SubnetManager implements SubnetService { |
160 | return false; | 159 | return false; |
161 | } | 160 | } |
162 | } | 161 | } |
163 | - } | ||
164 | return true; | 162 | return true; |
165 | } | 163 | } |
166 | 164 | ||
167 | @Override | 165 | @Override |
168 | public boolean removeSubnets(Iterable<SubnetId> subnetIds) { | 166 | public boolean removeSubnets(Iterable<SubnetId> subnetIds) { |
169 | checkNotNull(subnetIds, SUBNET_ID_NULL); | 167 | checkNotNull(subnetIds, SUBNET_ID_NULL); |
170 | - if (subnetIds != null) { | ||
171 | for (SubnetId subnetId : subnetIds) { | 168 | for (SubnetId subnetId : subnetIds) { |
172 | subnetStore.remove(subnetId); | 169 | subnetStore.remove(subnetId); |
173 | if (subnetStore.containsKey(subnetId)) { | 170 | if (subnetStore.containsKey(subnetId)) { |
... | @@ -176,7 +173,6 @@ public class SubnetManager implements SubnetService { | ... | @@ -176,7 +173,6 @@ public class SubnetManager implements SubnetService { |
176 | return false; | 173 | return false; |
177 | } | 174 | } |
178 | } | 175 | } |
179 | - } | ||
180 | return true; | 176 | return true; |
181 | } | 177 | } |
182 | 178 | ... | ... |
-
Please register or login to post a comment