Skip to content

Commit 8a94c4a

Browse files
committed
simplify
1 parent a470e19 commit 8a94c4a

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

src/NetworkTest/testQuality/helpers/getPublisherRtcStatsReport.ts

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,32 +77,18 @@ const determineRoutingResolution = (
7777
return 'Routed';
7878
}
7979

80-
if (remoteType === 'relay') {
81-
if (protocol === 'tcp') {
82-
return 'Relayed (TURN/TLS)';
83-
}
84-
return 'Relayed (TURN/UDP)';
85-
}
80+
const isTcp = protocol === 'tcp';
8681

87-
if (localType === 'relay') {
88-
if (protocol === 'tcp') {
89-
return 'Relayed (TURN/TLS)';
90-
}
91-
return 'Relayed (TURN/UDP)';
82+
if (localType === 'relay' || remoteType === 'relay') {
83+
return isTcp ? 'Relayed (TURN/TLS)' : 'Relayed (TURN/UDP)';
9284
}
9385

9486
if (localType === 'srflx' || remoteType === 'srflx') {
95-
if (protocol === 'tcp') {
96-
return 'Relayed (STUN/TLS)';
97-
}
98-
return 'Relayed (STUN/UDP)';
87+
return isTcp ? 'Relayed (STUN/TLS)' : 'Relayed (STUN/UDP)';
9988
}
10089

10190
if (localType === 'prflx' || remoteType === 'prflx') {
102-
if (protocol === 'tcp') {
103-
return 'Relayed (STUN/TLS)';
104-
}
105-
return 'Relayed (STUN/UDP)';
91+
return isTcp ? 'Relayed (STUN/TLS)' : 'Relayed (STUN/UDP)';
10692
}
10793
return 'Unknown';
10894
};

0 commit comments

Comments
 (0)