This project has moved. For the latest updates, please go here.
1

Resolved

Optimize of_getObjects

description

The Function of_getObjects in pfc_n_cst_dssrv and pfc_n_cst_dwsrv performs not optimal. There are always three calls to function Describe (for Type, Band and Visible) for each object because all checks are in one IF statement.
It would be better to do the easy checks first.

suggestion:
change this
If (lower(ids_Requestor.Describe(ls_ObjHolder + ".type")) = as_ObjType or as_ObjType = "*") And &
    (lower(ids_Requestor.Describe(ls_ObjHolder + ".band")) = as_Band or as_Band = "*") And &
    (lower(ids_Requestor.Describe(ls_ObjHolder + ".visible")) = "1" Or Not ab_VisibleOnly) Then
        li_Count ++
        as_ObjList[li_Count] = ls_ObjHolder
End if 
to this
lb_found = true
If as_ObjType <> "*" Then
    lb_found = (lower(ids_Requestor.Describe(ls_ObjHolder + ".type")) = as_ObjType)
End If
If lb_found AND as_Band <> "*" Then
    lb_found = (lower(ids_Requestor.Describe(ls_ObjHolder + ".band")) = as_Band)
End If
If lb_found AND ab_VisibleOnly Then
    lb_found = (lower(ids_Requestor.Describe(ls_ObjHolder + ".visible")) = "1")
End If
If lb_found Then
    li_Count ++
    as_ObjList[li_Count] = ls_ObjHolder
End if

comments