performance improvement for GET_ROW

Iterator logic removed and hash table logic inserted to the GET_ROW method.
This commit is contained in:
Bilen 2018-03-20 20:53:53 +08:00 committed by GitHub
parent cb1364b65f
commit 2f8b93f2a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4098,20 +4098,14 @@ method GET_RANGES_ITERATOR.
METHOD get_row. METHOD get_row.
DATA: lo_row_iterator TYPE REF TO cl_object_collection_iterator, * performance improvement for issue #527
lo_row TYPE REF TO zcl_excel_row. READ TABLE ROWS->DT_ROWS ASSIGNING FIELD-SYMBOL(<LS_ROW>) WITH TABLE KEY ROW_INDEX = IP_ROW.
IF SY-SUBRC = 0.
EO_ROW = <LS_ROW>-ROW.
ENDIF.
lo_row_iterator = me->get_rows_iterator( ). IF EO_ROW IS NOT BOUND.
WHILE lo_row_iterator->has_next( ) = abap_true. EO_ROW = ME->ADD_NEW_ROW( IP_ROW ).
lo_row ?= lo_row_iterator->get_next( ).
IF lo_row->get_row_index( ) = ip_row.
eo_row = lo_row.
EXIT.
ENDIF.
ENDWHILE.
IF eo_row IS NOT BOUND.
eo_row = me->add_new_row( ip_row ).
ENDIF. ENDIF.
ENDMETHOD. ENDMETHOD.