Skip to content

Commit

Permalink
Test & assign .chrDlm rather than assign, test, re-assign.
Browse files Browse the repository at this point in the history
  • Loading branch information
c-blake committed Feb 14, 2024
1 parent ba16ace commit 39f6fbc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cligen/mslice.nim
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,8 @@ proc initSep*(seps: string): Sep =
of 'n': result.setDlm.incl '\n'
else : result.setDlm.incl d
result.n = result.setDlm.card
result.chrDlm = seps[0]
if result.chrDlm == '0': result.chrDlm = '\0'
if result.chrDlm == 't': result.chrDlm = '\t'
if result.chrDlm == 'n': result.chrDlm = '\n'
result.chrDlm = if seps[0] == '0': '\0' elif seps[0] == 't': '\t'
elif seps[0] == 'n': '\n' else: seps[0]
result.repeat = result.setDlm.card < seps.len

type Splitr* {.deprecated: "use Sep".} = Sep
Expand Down

0 comments on commit 39f6fbc

Please sign in to comment.