From 89c5d9e0e76b4cf8f6eef5325cca211ed3f4fa4a Mon Sep 17 00:00:00 2001 From: Chris Randles Date: Mon, 30 Sep 2024 16:55:34 -0400 Subject: [PATCH] early exit unescape --- maps/maps.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/maps/maps.go b/maps/maps.go index 55271c5..35c07db 100644 --- a/maps/maps.go +++ b/maps/maps.go @@ -83,6 +83,9 @@ func flatten(m map[string]interface{}, keys []string, delim string, out map[stri } func unescape(keyPairs []string, delim string) []string { + if delim == "" { + return keyPairs + } var result []string for _, kp := range keyPairs { // first pass, unescape the delimiter