Skip to content

Commit

Permalink
Fixed some Scala style errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjiajin committed Jul 24, 2015
1 parent 216ab0c commit ae8c02d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private[fpm] object LocalPrefixSpan extends Logging with Serializable {
if (element.length > 1 && flag == 1) {
element.take(element.length - 1) ++ originalSequence
} else if (element.length == 1 && flag == 1) {
val firstPosition = originalSequence.indexOf(-1)
val firstPosition = originalSequence.indexOf( -1 )
if (firstPosition != -1) {
originalSequence.drop(firstPosition + 1)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class PrefixSpan private (

private def sortSequences(sequences: RDD[Array[Int]]): RDD[Array[Int]] = {
sequences.map { sequence =>
val sortedArray: ArrayBuffer[Int] = ArrayBuffer()
val sortedArray: ArrayBuffer[Int] = ArrayBuffer()
var currentIndex = -1
var nextIndex = 0
while (nextIndex != -1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ class PrefixSpanSuite extends SparkFunSuite with MLlibTestSparkContext {
"f,c,b:2")
val intExpectedValue = expectedValue4
.map(_.split(":"))
.map(x => (x.apply(0).split(",").flatMap(-1 +: _.toArray.map(coder)).drop(1), x.apply(1).toLong))
.map { x =>
(x.apply(0).split(",").flatMap(-1 +: _.toArray.map(coder)).drop(1), x.apply(1).toLong) }
assert(compareResult(intExpectedValue, result4.collect()))
}
}

0 comments on commit ae8c02d

Please sign in to comment.