Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-919

MutableOffsetMap could allocate newKeys lazily

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Medium
    • Resolution: Done
    • None
    • 2.1.5, 2.0.14
    • None
    • None

    Description

      As it stands, every time we allocate a MutableOffsetMap, the (Linked)HashMap is also allocated to hold new key mappings.

      This is strictly not necessary, as we can allocate this map when there is a need for it. This should have no ill effects, as the class is not thread-safe anyway.

      Lazy allocation will mean that in case we can satisfy the operations using arrays only (removal, unordered replacements), we will never allocate the map.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: