Skip to content

Commit

Permalink
Introduce Token Map: An optimized static translation class.
Browse files Browse the repository at this point in the history
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 #5373
Discussed in https://core.trac.wordpress.org/ticket/60698

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


git-svn-id: https://develop.svn.wordpress.org/trunk@58188 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
dmsnell committed May 23, 2024
1 parent 932895b commit bcd25b1
Show file tree
Hide file tree
Showing 7 changed files with 4,891 additions and 0 deletions.
Loading

0 comments on commit bcd25b1

Please sign in to comment.