Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-22403

Clean up dynamic_cast's in pipeline directory

    XMLWordPrintable

    Details

    • Backwards Compatibility:
      Fully Compatible

      Description

      We often use dynamic_cast when we really want to check if something is an exact type. dynamic_cast is unnecessarily expensive for this use, and we should use typeid instead.

      For example, we could create a helper as follows:

      template <TargetClass>
      bool exactDynamicCast(void* srcObj) {
          return typeid(TargetClass) == typeid(*srcObj);
      }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-query-optimization Backlog - Query Optimization
              Reporter:
              charlie.swanson Charlie Swanson
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated: