libkdtree icon indicating copy to clipboard operation
libkdtree copied to clipboard

三元运算符

Open xandery-geek opened this issue 7 years ago • 1 comments

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; 虽然那么写执行的结果是一样的,但是多了两次赋值,而且阅读代码时会让人感到困惑。

xandery-geek avatar Jun 07 '19 10:06 xandery-geek

多谢,改一下

发自我的 iPhone

在 2019年6月7日,18:05,yuanxu <[email protected]mailto:[email protected]> 写道:

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; 虽然那么写执行的结果是一样的,但是多了两次赋值,而且阅读代码时会让人感到困惑。

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/WiseDoge/libkdtree/issues/2?email_source=notifications&email_token=AEBW55Y22I5KKETKAVEGXZTPZIXHZA5CNFSM4HVU56RKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GYG4LYQ, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEBW554XPFEB7ATDM5V6STLPZIXHZANCNFSM4HVU56RA.

liuslnlp avatar Jun 07 '19 10:06 liuslnlp