[wp-trac] [WordPress Trac] #60698: Token Map: Introduce an efficient lookup and translation class for string mappings.

WordPress Trac noreply at wordpress.org
Thu May 23 19:54:33 UTC 2024


#60698: Token Map: Introduce an efficient lookup and translation class for string
mappings.
----------------------------------------------------+----------------------
 Reporter:  dmsnell                                 |       Owner:  dmsnell
     Type:  feature request                         |      Status:  closed
 Priority:  normal                                  |   Milestone:  6.6
Component:  General                                 |     Version:  trunk
 Severity:  normal                                  |  Resolution:  fixed
 Keywords:  has-patch needs-unit-tests 2nd-opinion  |     Focuses:
----------------------------------------------------+----------------------
Changes (by dmsnell):

 * owner:  (none) => dmsnell
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"58188" 58188]:
 {{{
 #!CommitTicketReference repository="" revision="58188"
 Introduce Token Map: An optimized static translation class.

 This patch introduces a new class: `WP_Token_Map`, designed for efficient
 lookup and translation of static mappings between string keys or tokens,
 and
 string replacements (for example, HTML character references).

 The Token Map imposes certain restrictions on the byte length of the
 lookup
 tokens and their replacements, but is a highly-optimized data structure
 for
 mappings with a very high number of tokens.

 Developed in https://github.com/WordPress/wordpress-develop/pull/5373
 Discussed in https://core.trac.wordpress.org/ticket/60698

 Fixes #60698.
 Props: dmsnell, gziolo, jonsurrell, jorbin.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60698#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list