[WASM] More optimal way to keep regex decomposition table

This commit is contained in:
Igor Yakovlev
2021-12-09 00:45:57 +01:00
parent 3e9ee8cf6f
commit 72e360be83
3 changed files with 352 additions and 2041 deletions
@@ -243,7 +243,7 @@ private fun getDecomposition(codePoint: Int): IntArray? {
if (index == -1 || decompositionKeys[index] != codePoint) {
return null
}
return decompositionValues[index]
return getDecompositionByIndex(index)
}
/** Gets canonical class for given codepoint from decomposition mappings table. */
@@ -257,9 +257,6 @@ internal fun hasSingleCodepointDecompositionInternal(ch: Int): Boolean {
return index != -1 && singleDecompositions[index] == ch
}
/** Returns a decomposition for a given codepoint. */
internal fun getDecompositionInternal(ch: Int): IntArray? = getDecomposition(ch)
/**
* Decomposes the given string represented as an array of codepoints. Saves the decomposition into [outputCodepoints] array.
* Returns the length of the decomposition.
File diff suppressed because it is too large Load Diff