问题标签 [extension-function]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
91 问题
0
投票
1
回答
33
浏览
performance - Kotlin 集合操作的有效性
我想为一个集合创建一个扩展函数来检查一个集合是否包含任何已定义集合的项目。我考虑了两种实现:
或者
问题是哪种方式更有效,为什么?有没有更好的解决方案?