Skip to content

Commit 63c6e8a

Browse files
authored
Update G.FUD.01.md (#136)
* Update G.FUD.01.md 加入 较少参数,存在性能收益可能性 的解释 原因如下 1,rust编译的 硬件指令对于较少函数参数会优先使用寄存器(大部分如此) 2,ffi 类型的函数,有明确规范定义 * Update G.FUD.01.md fix url 补充调用规范
1 parent 80c4ae0 commit 63c6e8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/safe-guides/coding_practice/fn-design/G.FUD.01.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
**【描述】**
66

7-
为了提升代码可读性,函数的参数最长不宜超过五个。
7+
为了提升代码可读性,函数的参数最长不宜超过五个。根据编译器函数调用规范[[1](https://www.cnblogs.com/shines77/p/3788514.html)][[2](https://learn.microsoft.com/zh-cn/cpp/build/x64-calling-convention?view=msvc-170)],较少的参数个数编译器优先使用寄存器,所以
8+
存在性能收益的可能性。
89

910
**【反例】**
1011

0 commit comments

Comments
 (0)