【发布时间】:2013-02-28 03:28:13
【问题描述】:
这就是我现在正在做的事情:
private var accounts = Vector.empty[Account]
def removeAccount(account: Account)
{
accounts = accounts.filterNot(_ == account)
}
有没有更易读的解决方案?理想情况下,我想写accounts = accounts.remove(account)。
【问题讨论】:
-
如果帐户存在两个(或更多)副本,应该怎么办?
标签: scala collections vector immutability trie