Refactor: Simplify method
Change-Id: I2fc8bed7ab41d3577cb8bb31af48941a2d738010
Showing
1 changed file
with
4 additions
and
7 deletions
... | @@ -446,25 +446,22 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu | ... | @@ -446,25 +446,22 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu |
446 | } | 446 | } |
447 | 447 | ||
448 | private Pair<OchPort, OchPort> findPorts(ConnectPoint src, ConnectPoint dst, CltSignalType signalType) { | 448 | private Pair<OchPort, OchPort> findPorts(ConnectPoint src, ConnectPoint dst, CltSignalType signalType) { |
449 | - Pair<OchPort, OchPort> ochPorts = null; | ||
450 | // According to the OpticalCircuitIntent's signalType find OCH ports with available TributarySlots resources | 449 | // According to the OpticalCircuitIntent's signalType find OCH ports with available TributarySlots resources |
451 | switch (signalType) { | 450 | switch (signalType) { |
452 | case CLT_1GBE: | 451 | case CLT_1GBE: |
453 | case CLT_10GBE: | 452 | case CLT_10GBE: |
454 | // First search for OCH ports with OduSignalType of ODU2. If not found - search for those with ODU4 | 453 | // First search for OCH ports with OduSignalType of ODU2. If not found - search for those with ODU4 |
455 | - ochPorts = findPorts(src, dst, OduSignalType.ODU2); | 454 | + Pair<OchPort, OchPort> ochPorts = findPorts(src, dst, OduSignalType.ODU2); |
456 | if (ochPorts == null) { | 455 | if (ochPorts == null) { |
457 | ochPorts = findPorts(src, dst, OduSignalType.ODU4); | 456 | ochPorts = findPorts(src, dst, OduSignalType.ODU4); |
458 | } | 457 | } |
459 | - break; | 458 | + return ochPorts; |
460 | case CLT_100GBE: | 459 | case CLT_100GBE: |
461 | - ochPorts = findPorts(src, dst, OduSignalType.ODU4); | 460 | + return findPorts(src, dst, OduSignalType.ODU4); |
462 | - break; | ||
463 | case CLT_40GBE: | 461 | case CLT_40GBE: |
464 | default: | 462 | default: |
465 | - break; | 463 | + return null; |
466 | } | 464 | } |
467 | - return ochPorts; | ||
468 | } | 465 | } |
469 | 466 | ||
470 | private Pair<OchPort, OchPort> findPorts(ConnectPoint src, ConnectPoint dst, OduSignalType ochPortSignalType) { | 467 | private Pair<OchPort, OchPort> findPorts(ConnectPoint src, ConnectPoint dst, OduSignalType ochPortSignalType) { | ... | ... |
-
Please register or login to post a comment