Skip to content

Commit

Permalink
simplify logical expression
Browse files Browse the repository at this point in the history
  • Loading branch information
khyatimahendru committed Dec 9, 2024
1 parent 73b82df commit f5fb4c2
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,9 @@ private DiscoveryConfig getDiscoveryConfig() {
FamilyDiscoveryModel familyDiscoveryModel = metadata.discovery.families.get(family);
if (familyDiscoveryModel != null) {
// for a sporadic scan, supplying generation is invalid
if (familyDiscoveryModel.scan_interval_sec == null) {
checkState(familyDiscoveryModel.generation == null,
"generation specified without scan_interval_sec parameter");
}
checkState(familyDiscoveryModel.scan_interval_sec != null ||
familyDiscoveryModel.generation == null,
"generation specified without scan_interval_sec parameter");

FamilyDiscoveryConfig familyDiscoveryConfig = new FamilyDiscoveryConfig();
familyDiscoveryConfig.generation = familyDiscoveryModel.generation;
Expand Down

0 comments on commit f5fb4c2

Please sign in to comment.