【新提案】逆向迭代Map、Set等目前仅供迭代访问的原生数据结构 #48
Unanswered
LongTengDao
asked this question in
Ideas
Replies: 1 comment 1 reply
-
如果你是说 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
时不时会遇到需要逆向消费Map的场景,整个解构为数组再逆向,时空开销太大。
当然了,我不太了解底层实现,这个提案是建立在这并不会导致严重的底层实现的性能浪费的前提下的。
否则这毕竟是相对小概率的场景,实际需要时自行解构为数组,当然好过一律支付为了兼容新功能而浪费的底层索引开销(比如把单向链表变成双向链表,多存储了一倍的索引)。
Beta Was this translation helpful? Give feedback.
All reactions