
我非常努力地理解为什么迭代器的行为如此.我的意思是表演一次
result = lines.filter(_.nonEmpty).map(_.toInt)
Run Code Online (Sandbox Code Playgroud)
迭代器缓冲区覆盖了除最后一个元素之外的所有elemnets.
我的意思是如果在给出5次之后我的输入文本文件中有5个元素
result = lines.filter(_.nonEmpty).map(_.toInt)
Run Code Online (Sandbox Code Playgroud)
我的迭代器变空了.
非常感谢任何帮助....在此先感谢