From 39f6fbc1d7a1b821366f2f764050221f06e53ee7 Mon Sep 17 00:00:00 2001 From: Charles Blake Date: Wed, 14 Feb 2024 05:00:37 -0500 Subject: [PATCH] Test & assign `.chrDlm` rather than assign, test, re-assign. --- cligen/mslice.nim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cligen/mslice.nim b/cligen/mslice.nim index 8608bc20..2a1c00f2 100644 --- a/cligen/mslice.nim +++ b/cligen/mslice.nim @@ -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