Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • openfoam openfoam
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 420
    • Issues 420
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Merge requests
  • !378

autoPtr/tmp cleanup

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Mark OLESEN requested to merge enh-memory-cleanup into develop Jul 16, 2020
  • Overview 2
  • Commits 8
  • Changes 199

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 Jul 16, 2020 by Mark OLESEN
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: enh-memory-cleanup