Skip to content

Commit

Permalink
ReadAheadIterator headOptionReverseCompatibility Altered To Final Val…
Browse files Browse the repository at this point in the history
…ue Class

Utilizes value class to avoid allocating runtime objects unnecessarily, and is final so that the behavior cannot be overridden in subclasses
  • Loading branch information
ChristopherDavenport committed Sep 1, 2016
1 parent 03a22d3 commit 54df14c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion slick/src/main/scala/slick/util/ReadAheadIterator.scala
Expand Up @@ -47,7 +47,7 @@ trait ReadAheadIterator[+T] extends BufferedIterator[T] {
object ReadAheadIterator { object ReadAheadIterator {


/** Feature implemented in Scala library 2.12 this maintains functionality for 2.11 */ /** Feature implemented in Scala library 2.12 this maintains functionality for 2.11 */
implicit class headOptionReverseCompatibility[T](readAheadIterator: ReadAheadIterator[T]){ final implicit class headOptionReverseCompatibility[T](val readAheadIterator: ReadAheadIterator[T]) extends AnyVal {
def headOption : Option[T] = if (readAheadIterator.hasNext) Some(readAheadIterator.head) else None def headOption : Option[T] = if (readAheadIterator.hasNext) Some(readAheadIterator.head) else None
} }
} }

0 comments on commit 54df14c

Please sign in to comment.