Skip to content
Snippets Groups Projects
Commit 9af3f85c authored by Mark OLESEN's avatar Mark OLESEN
Browse files

STYLE: simplify short-circuit involving autoPtr (#1775)

- with '&&' conditions, often better to check for non-null autoPtr
  first (it is cheap)

- check as bool instead of valid() method for cleaner code, especially
  when the wrapped item itself has a valid/empty or good.
  Also when handling multiple checks.

  Now
      if (ptr && ptr->valid())
      if (ptr1 || ptr2)

  instead
      if (ptr.valid() && ptr->valid())
      if (ptr1.valid() || ptr2.valid())
parent 3baebcb1
1 merge request!378autoPtr/tmp cleanup
Showing
with 79 additions and 78 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment