-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up - removed 27 warnings #1817
Conversation
# Conflicts: # src/test/scala/beam/integration/ParkingSpec.scala # src/test/scala/beam/integration/ridehail/RideHailBufferedRidesSpec.scala
@@ -249,7 +249,7 @@ class RideHailModifyPassengerScheduleManager( | |||
|
|||
def startWaveOfRepositioningOrBatchedReservationRequests(tick: Int, triggerId: Long): Unit = { | |||
assert( | |||
vehicleIdToModifyPassengerScheduleStatus.toVector.unzip._2.count(x => x.nonEmpty) | |||
vehicleIdToModifyPassengerScheduleStatus.toVector.map(_._2).count(x => x.nonEmpty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just do count(x => x._2.nonEmpty)
?
.filter(_.isDefined) | ||
.headOption | ||
.getOrElse(None) | ||
.find(_.isDefined) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be cleaned even further:
.collectFirst{ case Some(x) => x }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
collectFirst will extract using destructor and then instantiate again a new Option/Some
(it was already option previously). Syntax is a little bit better, but not sure it is worthy for this specific case. Applied suggestion anyway
test! |
1 similar comment
test! |
This change is