From 516348e35457ecbd24773e381a363e5e179613e6 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Tue, 29 Nov 2022 10:57:03 +0200 Subject: [PATCH] minor --- context/context.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/context/context.go b/context/context.go index 8cffa0d2..b4ef79be 100644 --- a/context/context.go +++ b/context/context.go @@ -1530,8 +1530,11 @@ func (ctx *Context) URLParamSlice(name string) []string { if n == 0 { return values } - - sepPtr := ctx.app.ConfigurationReadOnly().GetURLParamSeparator() + + var sep string + if sepPtr := ctx.app.ConfigurationReadOnly().GetURLParamSeparator(); sepPtr != nil { + sep = *sepPtr + } normalizedValues := make([]string, 0, n) for _, v := range values { @@ -1539,12 +1542,10 @@ func (ctx *Context) URLParamSlice(name string) []string { continue } - if sepPtr != nil { - if sep := *sepPtr; sep != "" { - values := strings.Split(v, sep) - normalizedValues = append(normalizedValues, values...) - continue - } + if sep != "" { + values := strings.Split(v, sep) + normalizedValues = append(normalizedValues, values...) + continue } normalizedValues = append(normalizedValues, v)