[WASM] More optimal way to keep regex decomposition table
This commit is contained in:
@@ -777,9 +777,6 @@ internal class Lexer(val patternString: String, flags: Int) {
|
|||||||
fun hasDecompositionNonNullCanClass(ch: Int): Boolean =
|
fun hasDecompositionNonNullCanClass(ch: Int): Boolean =
|
||||||
(ch == 0x0340) or (ch == 0x0341) or (ch == 0x0343) or (ch == 0x0344)
|
(ch == 0x0340) or (ch == 0x0341) or (ch == 0x0343) or (ch == 0x0344)
|
||||||
|
|
||||||
/** Gets decomposition for given codepoint from decomposition mappings table. */
|
|
||||||
fun getDecomposition(ch: Int): IntArray? = getDecompositionInternal(ch)
|
|
||||||
|
|
||||||
// =============================================================================================================
|
// =============================================================================================================
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ private fun getDecomposition(codePoint: Int): IntArray? {
|
|||||||
if (index == -1 || decompositionKeys[index] != codePoint) {
|
if (index == -1 || decompositionKeys[index] != codePoint) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
return decompositionValues[index]
|
return getDecompositionByIndex(index)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Gets canonical class for given codepoint from decomposition mappings table. */
|
/** 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
|
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.
|
* Decomposes the given string represented as an array of codepoints. Saves the decomposition into [outputCodepoints] array.
|
||||||
* Returns the length of the decomposition.
|
* Returns the length of the decomposition.
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user