diff --git a/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorageBackend.scala b/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorageBackend.scala
index fb57761037..f9273f05dd 100644
--- a/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorageBackend.scala
+++ b/akka-persistence/akka-persistence-cassandra/src/main/scala/CassandraStorageBackend.scala
@@ -117,7 +117,14 @@ private[akka] object CassandraStorageBackend extends
else throw new NoSuchElementException("No element for vector [" + name + "] and index [" + index + "]")
}
- def getVectorStorageRangeFor(name: String, start: Option[Int], finish: Option[Int], count: Int): List[Array[Byte]] = {
+ /**
+ * if start and finish both are defined, ignore count and
+ * report the range [start, finish)
+ * if start is not defined, assume start = 0
+ * if start == 0 and finish == 0, return an empty collection
+ */
+ def getVectorStorageRangeFor(name: String, start: Option[Int], finish: Option[Int], count: Int):
+ List[Array[Byte]] = {
val startBytes = if (start.isDefined) intToBytes(start.get) else null
val finishBytes = if (finish.isDefined) intToBytes(finish.get) else null
val columns: List[ColumnOrSuperColumn] = sessions.withSession {
diff --git a/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala b/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala
index 8e2adaa5c3..b1973c3c7b 100644
--- a/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala
+++ b/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala
@@ -226,18 +226,17 @@ private [akka] object RedisStorageBackend extends
}
}
+ /**
+ * if start and finish both are defined, ignore count and
+ * report the range [start, finish)
+ * if start is not defined, assume start = 0
+ * if start == 0 and finish == 0, return an empty collection
+ */
def getVectorStorageRangeFor(name: String, start: Option[Int], finish: Option[Int], count: Int): List[Array[Byte]] = withErrorHandling {
- /**
- * if start and finish both are defined, ignore count and
- * report the range [start, finish)
- * if start is not defined, assume start = 0
- * if start == 0 and finish == 0, return an empty collection
- */
val s = if (start.isDefined) start.get else 0
val cnt =
if (finish.isDefined) {
val f = finish.get
- // if (f >= s) Math.min(count, (f - s)) else count
if (f >= s) (f - s) else count
}
else count