Skip to content

Commit

Permalink
Merge pull request #1424 from xuwei-k/toIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n authored Oct 3, 2024
2 parents 120c669 + 4538499 commit 18b136a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ trait NativeCopyLoader extends ClassLoader {

private[this] def findLibrary0(name: String): String = {
val mappedName = System.mapLibraryName(name)
val explicit = explicitLibraries.toIterator.filter(_.getFileName.toString == mappedName)
val search = searchPaths.toIterator flatMap relativeLibrary(mappedName)
val explicit = explicitLibraries.iterator.filter(_.getFileName.toString == mappedName)
val search = searchPaths.iterator flatMap relativeLibrary(mappedName)
val combined = explicit ++ search
if (combined.hasNext) copy(combined.next()) else null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ object Locate {
}
}
def find[S](name: String, gets: Stream[String => Either[Boolean, S]]): Either[Boolean, S] =
find[S](name, gets.toIterator)
find[S](name, gets.iterator)

/**
* Returns a function that searches the provided class path for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ trait RelationsTextFormat extends FormatCommons {
def read(in: BufferedReader): Relations = {
def readRelation[A, B](relDesc: Descriptor[A, B]): Map[A, Set[B]] = {
import relDesc._
val items = readPairs(in)(header, keyMapper.read, valueMapper.read).toIterator
val items = readPairs(in)(header, keyMapper.read, valueMapper.read).iterator
// Reconstruct the multi-map efficiently, using the writing strategy above
val builder = Map.newBuilder[A, Set[B]]
var currentKey = null.asInstanceOf[A]
Expand Down

0 comments on commit 18b136a

Please sign in to comment.