From d8df81d562a3db8f848aa680e49c1e45483bdf21 Mon Sep 17 00:00:00 2001 From: afrmtbl Date: Sat, 30 Mar 2019 20:56:42 -0400 Subject: [PATCH] Simplified JSONSkeleton / SkeletonValue situation --- src/invidious/helpers/json_filter.cr | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/invidious/helpers/json_filter.cr b/src/invidious/helpers/json_filter.cr index fb33c675..e4b57cea 100644 --- a/src/invidious/helpers/json_filter.cr +++ b/src/invidious/helpers/json_filter.cr @@ -171,11 +171,10 @@ module JSONFilter end class FieldsGrouper - alias JSONSkeleton = Hash(String, JSONSkeleton) - alias SkeletonValue = Hash(String, JSONSkeleton) + alias SkeletonValue = Hash(String, SkeletonValue) def self.create_json_skeleton(fields_text : String) : SkeletonValue - root_hash = SkeletonValue.new + root_hash = {} of String => SkeletonValue FieldsParser.parse_fields(fields_text) do |nest_list| current_item = root_hash @@ -183,7 +182,7 @@ module JSONFilter if current_item[key]? current_item = current_item[key] else - current_item[key] = SkeletonValue.new + current_item[key] = {} of String => SkeletonValue current_item = current_item[key] end end