Skip to content

Function call optimization#615

Open
sergiocastelani wants to merge 2 commits intospadrapo:masterfrom
sergiocastelani:function-call-optimization
Open

Function call optimization#615
sergiocastelani wants to merge 2 commits intospadrapo:masterfrom
sergiocastelani:function-call-optimization

Conversation

@sergiocastelani
Copy link
Copy Markdown
Contributor

This pull request refactors the DrapoFunctionHandler class to streamline how function executions are handled. Instead of a long series of conditional statements, it introduces a centralized map of function executors, allowing for easier maintenance and optimized function search. Several function signatures are also updated to ensure consistency in how parameters are passed.

Refactoring for maintainability and extensibility:

  • Introduced a _functionExecutors map in DrapoFunctionHandler to associate function names with their executor methods, replacing the previous large conditional block. [1] [2] [3]
  • Moved those pages that can't be tested automatically from folder DrapoPages to the new folder ManualTests.

Consistency improvements:

  • Updated the signatures of ExecuteFunctionExternal, ExecuteFunctionReloadPage, and ExecuteFunctionClosePage to accept all standard parameters, including sector, contextItem, element, event, functionParsed, and executionContext, and made them asynchronous for consistency with other executors. [1] [2]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant