Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8244733

Add ResourceHashtable::xxx_if_absent

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 15
    • 15
    • hotspot
    • b24

      A common pattern when using ResourceHashTable is:

      if (table.get(k) == NULL) table.add(k,v);

      This runs the lookup code twice. By providing methods "xxx_if_absent" - similar to how j.u.Map does - we could reduce the number of lookups needed.

            stuefe Thomas Stuefe
            stuefe Thomas Stuefe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: