pavanky · GitHub

Conversation

@umar456

Copy link Copy Markdown

Member

The ternary operator was not working correctly in vs2015.

build arrayfire windows ci

pavanky

min(corners_found, max_corners) :
min(corners_found, corner_lim);
if (max_corners > 0) { *corners_out = min(corners_found, max_corners); }
else { *corners_out = min(corners_found, corner_lim); }

Copy link Copy Markdown

Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*corners_out = min(corners_found, max_corners > 0 ? max_corners : corner_lim)

Copy link Copy Markdown

Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just want to avoid ternaries altogether.

Copy link Copy Markdown

Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright

@9prady9

Copy link Copy Markdown

Member

Aren't there other places that uses ternary operator in similar fashion ?

@umar456

Copy link Copy Markdown

Member Author

build arrayfire windows ci

@umar456

Copy link Copy Markdown

Member Author

build arrayfire windows ci

@umar456

@umar456

Read the original on github.com ↗