@@ -232,7 +232,17 @@ function initialize_extension_manager() {
232232 hook_point_functions=" "
233233 declare hook_point_function_sortname
234234 for hook_point_function_sortname in ${hook_point_functions_sorted_by_sort_id} ; do
235- hook_point_functions=" ${hook_point_functions} ${hook_point_functions_sortname_to_realname[${hook_point_function_sortname}]} "
235+ realname=" ${hook_point_functions_sortname_to_realname[${hook_point_function_sortname}]} "
236+ if [[ -v extension_optout && ${# extension_optout[@]} -ne 0 ]]; then
237+ # most common case this array is empty/non-existent, so bail out soonest
238+ for func in " ${extension_optout[@]} " ; do
239+ if [[ " $func " == " ${hook_point} __${realname} " ]]; then
240+ continue 2
241+ fi
242+ done
243+ fi
244+
245+ hook_point_functions=" ${hook_point_functions} ${realname} "
236246 done
237247 # shellcheck disable=SC2086
238248 hook_point_functions=" $( echo -n ${hook_point_functions} ) "
@@ -276,18 +286,6 @@ function initialize_extension_manager() {
276286 declare -a list_of_called_functions=()
277287
278288 for hook_point_function in ${hook_point_functions} ; do
279- opt_out=false
280- if [[ -v extension_optout && ${# extension_optout[@]} -ne 0 ]]; then
281- # most common case this array is empty/non-existent, so bail out soonest
282- for func in " ${extension_optout[@]} " ; do
283- if [[ " $func " == " ${hook_point} __${hook_point_function} " ]]; then
284- opt_out=true
285- fi
286- done
287- fi
288- if $opt_out ; then
289- continue; #skip processing this function
290- fi
291289 hook_point_functions_loop_counter=$(( hook_point_functions_loop_counter + 1 ))
292290
293291 # store the full name in a hash, so we can track which were actually called later.
0 commit comments