mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-11-13 09:16:10 +08:00
modified: eBook/18.1.md
modified: eBook/18.11.md modified: eBook/18.2.md modified: eBook/18.3.md
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
|
||||
(4)尽可能的使用数组和切片代替映射(详见 参考文献15);
|
||||
|
||||
(5)如果只想获取切片中某项值,不需要值的索引,尽可能的使用`for range`去遍历切片,这比必须去查询切片中的每个元素要快一些;
|
||||
(5)如果只想获取切片中某项值,不需要值的索引,尽可能的使用`for range`去遍历切片,这比必须去查询切片中的每个元素要快一些;
|
||||
|
||||
(6)当数组元素是稀疏的(例如有很多0值或者空值),使用映射会降低内存消耗;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user