Github user holdenk commented on a diff in the pull request:
https://github.com/apache/spark/pull/11067#discussion_r52061559
--- Diff:
streaming/src/test/scala/org/apache/spark/streaming/StreamingListenerSuite.scala
---
@@ -271,11 +274,16 @@ class StreamingListenerSuite extends TestSuiteBase
with Matchers {
}
/** Check if a sequence of numbers is in increasing order */
- def isInIncreasingOrder(seq: Seq[Long]): Boolean = {
- for (i <- 1 until seq.size) {
- if (seq(i - 1) > seq(i)) {
+ def isInIncreasingOrder(data: Iterable[Long]): Boolean = {
--- End diff --
We could make it a one-liner (see
http://stackoverflow.com/questions/7852471/idiomatic-construction-to-check-whether-a-collection-is-ordered
) but the one liners suggested don't short circuit on failure (although since
we always expect this to be true the lack of short circuiting is probably ok).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]