Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可能不准确的地方 #27

Closed
shangjiaxuan opened this issue Feb 27, 2019 · 1 comment
Closed

可能不准确的地方 #27

shangjiaxuan opened this issue Feb 27, 2019 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@shangjiaxuan
Copy link

翻到了这个指导,光看了readme的前几个部分就感觉十分有收获(到网络IO部分为止)。但是在看的同时对不熟悉的东西做了一下调查,觉得有下面几个地方可能可以优化一下?

  1. inline 函数似乎原则上可以含有复杂一些的,如循环的操作,尽管可能编译器并不会内联。参考的是在stackoverflow的讨论

  2. 并不是所有时候都是尽量使用const比较好。在返回值(非引用)的时候,const 返回值目前大部分情况下并不是一个很好的选择。参考的是stackoverflow的另一个讨论,和这个讨论指向的另一个

总之,非常感谢总结!

huihut added a commit that referenced this issue Feb 27, 2019
@huihut
Copy link
Owner

huihut commented Feb 27, 2019

感谢。

  1. 我改成 编译器一般不内联包含循环、递归、switch 等复杂操作的内联函数 了,
  2. 这个看使用场景吧,尽可能使用 const 也不是一味地使用。

@huihut huihut closed this as completed Feb 27, 2019
@huihut huihut added the help wanted Extra attention is needed label Feb 27, 2019
yyfst pushed a commit to yyfst/interview that referenced this issue Aug 17, 2022
添加答案和修改文章格式
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants