We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e4f8ca commit 20a2811Copy full SHA for 20a2811
mllib/src/main/scala/org/apache/spark/mllib/util/MLUtils.scala
@@ -83,14 +83,12 @@ object MLUtils {
83
(index, value)
84
}.unzip
85
86
- // check if indices is one-based and in ascending order
+ // check if indices are one-based and in ascending order
87
var previous = -1
88
var i = 0
89
val indicesLength = indices.size
90
while (i < indicesLength) {
91
- if (indices(i) <= previous) {
92
- throw new IllegalArgumentException("indices should be one-based and in ascending order")
93
- }
+ require(indices(i) > previous, "indices should be one-based and in ascending order" )
94
previous = indices(i)
95
i += 1
96
}
0 commit comments