【新提案】在Map、Set等的开头新增键的方法 #49
Unanswered
LongTengDao
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
目前的map.set等,当元素不存在时,都是在末尾添加新元素。这就意味着如果需要按添加顺序相反的顺序消费Map等,就会遇到麻烦。
当然,这是建立在Map的底层实现是类似链表而不是数组的前提下的,这种情况下增加这个功能惠而不费。否则就性价比不大了。
Beta Was this translation helpful? Give feedback.
All reactions