cnr-isti-vclab / piccante

The hottest High Dynamic Range (HDR) Library
http://vcg.isti.cnr.it/piccante/
Mozilla Public License 2.0
251 stars 60 forks source link

Remove unnecessary null pointer checks #19

Closed elfring closed 2 months ago

elfring commented 1 year ago

An extra null pointer check is not needed in functions like the following.

banterle commented 1 year ago

you are perfectly right. However, not all compilers for all platforms support that.

Did you measure a huge bottleneck from those IFs?

elfring commented 1 year ago

However, not all compilers for all platforms support that.

Would you like to point any tools out which are not compliant to the C++ standard according to the linked implementation detail?

:thought_balloon: Would you become interested to use a development tool like “clang-tidy” for corresponding source code adjustments?

banterle commented 1 year ago

Would you like to point any tools out which are not compliant to the C++ standard according to the linked implementation detail?

Probably old compilers.

Would you become interested to use a development tool like “clang-tidy” for corresponding source code adjustments

This aspect will be considered in the future. Probably when moving to smart pointers.

elfring commented 1 year ago

Probably old compilers.

Probably when moving to smart pointers.

:thought_balloon: I would find it helpful if redundant pointer checks could be deleted before occasionally.

banterle commented 1 year ago

Would you dare to restrict development support on C++ standard compliant tools?

Not now.

elfring commented 1 year ago

:crystal_ball: Do you need any configuration checks for incompliant tools (by the software build system)?

banterle commented 1 year ago

No, thank you.

elfring commented 1 year ago

:crystal_ball: In which time range do you plan to work more with smart pointers?

banterle commented 1 year ago

Why?

elfring commented 1 year ago

:thought_balloon: Smart pointers can also help to get rid of redundant pointer checks, can't they?

banterle commented 2 months ago

done

elfring commented 2 months ago

See also (for example): https://github.com/cnr-isti-vclab/piccante/commit/b225648800a84ecce396d7408583934a6c3cdf0f

banterle commented 2 months ago

could you be more specific, please?

elfring commented 2 months ago

:eyes: You adjusted several source code places (according to a requested transformation pattern) on 2024-08-22.