Skip to content
Snippets Groups Projects

autoPtr/tmp cleanup

Merged 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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply