mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2026-01-02 07:12:38 -08:00
Speed up reveal widget
It turns out that the `localeCompare` function used by `compareStateText()` is very, very slow. Replacing it with a straightforward equality test makes one of my test rigs be 10x faster... Note that this PR reverts the behaviour of match/nomatch to that before #3157. That change was not backwards compatible in that the switch to localeCompare meant that é === e, now it doesn't again.
This commit is contained in:
parent
dddfb7ce67
commit
7869546fef
1 changed files with 2 additions and 2 deletions
|
|
@ -142,10 +142,10 @@ RevealWidget.prototype.readState = function() {
|
|||
this.readPopupState(state);
|
||||
break;
|
||||
case "match":
|
||||
this.isOpen = !!(this.compareStateText(state) == 0);
|
||||
this.isOpen = this.text === state;
|
||||
break;
|
||||
case "nomatch":
|
||||
this.isOpen = !(this.compareStateText(state) == 0);
|
||||
this.isOpen = this.text !== state;
|
||||
break;
|
||||
case "lt":
|
||||
this.isOpen = !!(this.compareStateText(state) < 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue