mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-05 14:02:38 +08:00
performance improvement for GET_ROW
Iterator logic removed and hash table logic inserted to the GET_ROW method.
This commit is contained in:
parent
cb1364b65f
commit
2f8b93f2a5
|
@ -4098,20 +4098,14 @@ method GET_RANGES_ITERATOR.
|
|||
|
||||
METHOD get_row.
|
||||
|
||||
DATA: lo_row_iterator TYPE REF TO cl_object_collection_iterator,
|
||||
lo_row TYPE REF TO zcl_excel_row.
|
||||
* performance improvement for issue #527
|
||||
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( ).
|
||||
WHILE lo_row_iterator->has_next( ) = abap_true.
|
||||
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 ).
|
||||
IF EO_ROW IS NOT BOUND.
|
||||
EO_ROW = ME->ADD_NEW_ROW( IP_ROW ).
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
|
Loading…
Reference in New Issue
Block a user