Uploaded image for project: 'Mesos'
  1. Mesos
  2. MESOS-10000

Consider removing 'hashmap::get'

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: stout
    • Labels:

      Description

      hashmap<K, V>::get returns an Option<V> and is a convenient shortcut to avoid a contains check followed by e.g., hashmap::operator[]. Since it always creates a copy it can, however, be unnecessarily costly if the caller is not interested in storing the returned value, but e.g., only interested in invoking a member accessing a member in which case the contains check and operator[] are always preferrable for performance reasons.

      We should consider removing hashmap::get since it can easily lead to expensive code.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                bbannier Benjamin Bannier
              • Votes:
                1 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: