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

Clean up dynamic_cast's in pipeline directory

    • Query Optimization
    • Fully Compatible

      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);
      }
      

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: