diff options
author | bptato <nincsnevem662@gmail.com> | 2022-12-05 12:23:15 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-12-05 12:23:15 +0100 |
commit | 7fdc3a423754c25c05e376f8a02b7438350ed6eb (patch) | |
tree | 66bd9d28444cf5bc14125ddbad48c927bbd7cf82 /src/utils/twtstr.nim | |
parent | b31c6a2072b6897ae1ef355013fcd199496aee82 (diff) | |
download | chawan-7fdc3a423754c25c05e376f8a02b7438350ed6eb.tar.gz |
Remove unused twtstr functions
Diffstat (limited to 'src/utils/twtstr.nim')
-rw-r--r-- | src/utils/twtstr.nim | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim index 3d33f8d1..0bce4591 100644 --- a/src/utils/twtstr.nim +++ b/src/utils/twtstr.nim @@ -46,9 +46,6 @@ func onlyWhitespace*(s: string): bool = return false return true -func isControlChar*(c: char): bool = - return c in Controls - func isControlChar*(r: Rune): bool = case r of Rune(0x00)..Rune(0x1F): return true @@ -82,25 +79,6 @@ const controlLetterMap = genControlLetterMap() func getControlLetter*(c: char): char = return controlLetterMap[int(c)] -func findChar*(str: string, c: char, start: int = 0): int = - var i = start - while i < str.len: - if str[i] == c: - return i - inc i - return -1 - -func findChar*(str: string, c: Rune, start: int = 0): int = - var i = start - var n = i - while i < str.runeLen(): - var r: Rune - fastRuneAt(str, n, r) - if r == c: - return i - i = n - return -1 - const lowerChars = (func(): array[char, char] = for i in 0..255: if char(i) in 'A'..'Z': @@ -112,11 +90,6 @@ const lowerChars = (func(): array[char, char] = func tolower*(c: char): char = return lowerChars[c] -func toAsciiLower*(str: string): string = - result = newString(str.len) - for i in 0..str.high: - result[i] = str[i].tolower() - func toHeaderCase*(str: string): string = result = str var flip = true @@ -828,7 +801,7 @@ var width_table*: array[0..0x10FFFF, byte] func makewidthtable*(cjk: bool): array[0..0x10FFFF, byte] {.noInit.} = for r in low(char)..high(char): - if r.isControlChar(): + if r in Controls: result[int(r)] = 0 else: result[int(r)] = 1 |