Skip to content

Commit

Permalink
remove redundant property (optimization)
Browse files Browse the repository at this point in the history
  • Loading branch information
soson committed Jan 18, 2024
1 parent 6539bdd commit 12c28b6
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 13 deletions.
56 changes: 53 additions & 3 deletions src/__generated__/topology-discovery.graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions src/external-api/topology-discovery-graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,6 @@ const PTP_TOPOLOGY = gql`
idLink
name
status
ptpDevice {
...PtpInterfaceDeviceParts
}
ptpLink {
id
idLink
Expand Down
9 changes: 2 additions & 7 deletions src/helpers/topology.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,20 +405,15 @@ export function makePtpTopologyEdges(ptpDevices?: PtpTopologyQuery) {
return device.ptpInterfaces.edges
?.map((i) => {
const deviceInterface = i?.node;
if (
!deviceInterface ||
!deviceInterface.ptpLink ||
!deviceInterface.ptpLink.ptpDevice ||
!deviceInterface.ptpDevice
) {
if (!deviceInterface || !deviceInterface.ptpLink || !deviceInterface.ptpLink.ptpDevice) {
return null;
}

return {
id: `${deviceInterface.id}-${deviceInterface.ptpLink.id}`,
source: {
interface: deviceInterface.id,
nodeId: deviceInterface.ptpDevice.name,
nodeId: device.name,
},
target: {
interface: deviceInterface.ptpLink.id,
Expand Down

0 comments on commit 12c28b6

Please sign in to comment.