diff options
author | bptato <nincsnevem662@gmail.com> | 2023-09-07 17:04:14 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-09-07 17:04:33 +0200 |
commit | 9668b12761cb121852c2bcc085b8f6b18eb4bfc6 (patch) | |
tree | d8f5264f99117d22e47b3063512af5cd46366f29 /src/utils | |
parent | 62d78f3ca867b159d699d9580805c7c88e76bded (diff) | |
download | chawan-9668b12761cb121852c2bcc085b8f6b18eb4bfc6.tar.gz |
twtstr: remove some unused procs
* substr for Rune with 1 param: gone, ideally the other should be removed too * clearControls: gone, not used anymore. * split for Rune: gone, not used anymore.
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/twtstr.nim | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim index 3e8b5779..d7b8139a 100644 --- a/src/utils/twtstr.nim +++ b/src/utils/twtstr.nim @@ -196,11 +196,6 @@ func substr*(s: seq[Rune], i, j: int): seq[Rune] = return @[] return s[min(high(s), i)..min(high(s), j - 1)] -func substr*(s: seq[Rune], i: int): seq[Rune] = - if i > high(s) or s.len == 0: - return @[] - return s[min(high(s), i)..high(s)] - func stripAndCollapse*(s: string): string = var i = 0 while i < s.len and s[i] in AsciiWhitespace: @@ -575,11 +570,6 @@ func join*(ss: openarray[string], sep: char): string = result &= sep result &= ss[i] -func clearControls*(s: string): string = - for c in s: - if c notin Controls: - result &= c - proc passRealloc(opaque: pointer, p: pointer, size: csize_t): pointer {.cdecl.} = return realloc(p, size) @@ -810,18 +800,6 @@ proc expandPath*(path: string): string = if p != nil: result = $p.pw_dir / path.substr(i) -iterator split*(s: seq[Rune], sep: Rune): seq[Rune] = - var i = 0 - var prev = 0 - while i < s.len: - if s[i] == sep: - yield s.substr(prev, i) - prev = i - inc i - - if prev < i: - yield s.substr(prev, i) - # Combining chars from https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c # # The following two functions define the column width of an ISO 10646 |