Commit Graph

6 Commits

Author SHA1 Message Date
Mark Olesen
0ba43df9c5 STYLE: remove erroneous reference in dynamicCast use 2021-05-31 09:11:49 +02:00
Mark Olesen
9af3f85cf9 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())
2020-07-16 10:17:25 +02:00
Andrew Heather
fdf8d10ab4 Merge commit 'e9219558d7' into develop-v1906 2019-12-05 11:47:19 +00:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
Mark Olesen
c9cb4ce34f ENH: minor improvements, cleanup of token class
- relax casting rules
  * down-cast of labelToken to boolToken
  * up-cast of wordToken to stringToken.
    Can use isStringType() test for word or string types

- simplify constructors, move construct etc.

- expose reset() method as public, which resets to UNDEFINED and
  clears allocated storage etc.

DEFEATURE: remove assign from word or string pointer.

- This was deprecated 2017-11 and now removed.
  For this type of content transfer, move assignment should be used
  instead of stealing pointers.
2019-08-20 17:48:31 +02:00
Mark Olesen
2ae2783635 ENH: add a test dictionary token streaming class 2017-11-07 13:12:43 +01:00