Skip to content

widgetexplorer: Skip any previous failed keyword match

Fushan Wen requested to merge work/fusionfuture/efficient-match-applet into master

Currently, when the search pattern changes, Widget Explorer will match the pattern by keyword in every applet even the match is failed previously, which is not efficient.

This commit adds a boolean and a length counter.

  1. When keyword match fails, the boolean is set to true and the counter is set to the pattern length. If the user continues entering more text, any previous failed keyword match will be skipped.
  2. When the user deletes some text, if the pattern length is smaller than the counter, or the pattern only has one character, the boolean is reset to false, so keyword match will be done.

Merge request reports

Loading