Skip to content

autoPtr/tmp cleanup

Mark OLESEN requested to merge enh-memory-cleanup into develop

Mostly style (declutter) changes for autoPtr/tmp. The valid() and empty() methods tended to result (IMO) dense, hard to read code. Worst case example is an autoPtr wrapping of a tmp:

if (data.valid() && data().valid())

Which is somewhat easier to read with direct testing of the pointer, and a pointer deference:

if (data && data->valid())

Other cases of opaque code arise from the empty() with a negation:

if (!ptr.empty()) ... can use the pointer

instead of simply

if (ptr) ... can use the pointer

Removed some pre-nullObject (2014) code remnants from the tmp logic.

Edited by Mark OLESEN

Merge request reports