Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
openfoam
openfoam
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 367
    • Issues 367
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 11
    • Merge Requests 11
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Merge Requests
  • !378

Merged
Created Jul 16, 2020 by Mark Olesen@markMaintainer

autoPtr/tmp cleanup

  • 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
Reviewer
Request review from
v2012
Milestone
v2012 (Past due)
Assign milestone
Time tracking
Source branch: enh-memory-cleanup