uqall: check if % in it before action (performance?)

This commit is contained in:
julius 2022-07-10 02:39:49 +00:00
parent 2aa80f99e8
commit 009c59960c

View File

@ -22,7 +22,8 @@ def uqall(data):
iterator = enumerate(data)
elif isinstance(data, dict):
for k in list(data.keys()):
data[uq(k)] = data.pop(k)
if "%" in k:
data[uq(k)] = data.pop(k)
iterator = data.items()
elif isinstance(data, str):
data = [data]
@ -33,7 +34,8 @@ def uqall(data):
if isinstance(value, (list, dict)):
uqall(value)
elif isinstance(value, str):
data[i] = uq(value)
if "%" in value:
data[i] = uq(value)
return data