Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-12058 [Umbrella] Reduce unnecessary object allocations
  3. HBASE-12060

Replace enhanced for statement with basic for statement where possible

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Wherever we use the enhanced for construction:

          for ( FormalParameter : Expression ) Statement
      

      where the Expression evaluates to an array or collection type that supports random access, we can avoid creating iterator objects, unless we are also using the iterator to remove items while iterating by using the basic for statement instead:

      for ( ForInit ; Expression ; ForUpdate ) Statement
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                apurtell Andrew Kyle Purtell
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated: