From 2abc86dddb1c6e0bdbb8cb2129d9e26b7424a03b Mon Sep 17 00:00:00 2001 From: Xiangrui Meng Date: Sun, 26 Apr 2015 09:54:51 -0700 Subject: [PATCH] typo --- .../src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala b/mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala index c4210d9413a37..207d8455df31c 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala @@ -73,10 +73,11 @@ sealed trait Vector extends Serializable { */ override def hashCode(): Int = { // This is a reference implementation. It calls return in foreachActive, which is slow. + // Subclasses should override it with optimized implementation. var result: Int = 31 + size this.foreachActive { (index, value) => if (index < 16) { - // ignore explict 0 for comparison between sparse and dense + // ignore explicit 0 for comparison between sparse and dense if (value != 0) { result = 31 * result + index val bits = java.lang.Double.doubleToLongBits(value)