Skip to content

Commit 993c4d1

Browse files
committed
Cleanup casts
1 parent 7db857d commit 993c4d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main/scala/org/scalajs/dom/RTCConfiguration.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ object RTCConfiguration {
3131
peerIdentity: js.UndefOr[String] = js.undefined): RTCConfiguration = {
3232
val result = js.Dynamic.literal()
3333
iceServers.foreach(result.iceServers = _)
34-
iceTransportPolicy.map(_.asInstanceOf[js.Any]).foreach(result.iceTransportPolicy = _)
35-
bundlePolicy.map(_.asInstanceOf[js.Any]).foreach(result.bundlePolicy = _)
36-
peerIdentity.map(_.asInstanceOf[js.Any]).foreach(result.peerIdentity = _)
34+
iceTransportPolicy.foreach(x => result.iceTransportPolicy = x.asInstanceOf[js.Any])
35+
bundlePolicy.foreach(x => result.bundlePolicy = x.asInstanceOf[js.Any])
36+
peerIdentity.foreach(x => result.peerIdentity = x.asInstanceOf[js.Any])
3737
result.asInstanceOf[RTCConfiguration]
3838
}
3939
}

src/main/scala/org/scalajs/dom/RTCSessionDescriptionInit.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ object RTCSessionDescriptionInit {
1616
def apply(`type`: js.UndefOr[RTCSdpType] = js.undefined,
1717
sdp: js.UndefOr[String] = js.undefined): RTCSessionDescriptionInit = {
1818
val result = js.Dynamic.literal()
19-
`type`.map(_.asInstanceOf[js.Any]).foreach(result.`type` = _)
19+
`type`.foreach(x => result.`type` = x.asInstanceOf[js.Any])
2020
sdp.foreach(result.sdp = _)
2121
result.asInstanceOf[RTCSessionDescriptionInit]
2222
}

0 commit comments

Comments
 (0)