mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-02 12:19:11 +00: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
@ -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…
Reference in New Issue
Block a user