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

三元运算符 #2

Closed
xandery-geek opened this issue Jun 7, 2019 · 1 comment
Closed

三元运算符 #2

xandery-geek opened this issue Jun 7, 2019 · 1 comment

Comments

@xandery-geek
Copy link

p = coor[p->split] <= GetDimVal(p->id, p->split) ? p = p->left : p = p->right;
应该是这样吧: p = coor[p->split] <= GetDimVal(p->id, p->split) ? p->left : p->right;
虽然那么写执行的结果是一样的,但是多了两次赋值,而且阅读代码时会让人感到困惑。

@liuslnlp
Copy link
Owner

liuslnlp commented Jun 7, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants