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

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • None

    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

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

              Dates

                Created:
                Updated:
                Resolved: