Skip to content

Commit

Permalink
Removing more un-needed array-buffer to iterator conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
kellrott committed Feb 26, 2014
1 parent 627a8b7 commit c2fb430
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -360,7 +360,7 @@ private[spark] class BlockManager(
// TODO: Consider creating a putValues that also takes in a iterator? // TODO: Consider creating a putValues that also takes in a iterator?
val valuesBuffer = new ArrayBuffer[Any] val valuesBuffer = new ArrayBuffer[Any]
valuesBuffer ++= values valuesBuffer ++= values
memoryStore.putValues(blockId, valuesBuffer.toIterator, level, true).data match { memoryStore.putValues(blockId, valuesBuffer, level, true).data match {
case Left(values2) => case Left(values2) =>
return Some(values2) return Some(values2)
case _ => case _ =>
Expand Down Expand Up @@ -703,7 +703,7 @@ private[spark] class BlockManager(
logInfo("Writing block " + blockId + " to disk") logInfo("Writing block " + blockId + " to disk")
data match { data match {
case Left(elements) => case Left(elements) =>
diskStore.putValues(blockId, elements.toIterator, level, false) diskStore.putValues(blockId, elements, level, false)
case Right(bytes) => case Right(bytes) =>
diskStore.putBytes(blockId, bytes, level) diskStore.putBytes(blockId, bytes, level)
} }
Expand Down

0 comments on commit c2fb430

Please sign in to comment.