Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] use iterator instead of deprecated toIterator #1424

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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