Diff

mod_rest/jsonmap.lib.lua @ 4744:f478855f4565

mod_rest: Stop search when an implied type is determined Optimization only, as the iteration order is undefined. And not much since there's not that many entries in the implied_types map.
author Kim Alvefur <zash@zash.se>
date Thu, 04 Nov 2021 20:13:43 +0100
parent 4743:0a501df823fd
child 4746:88f5e12c8351
line wrap: on
line diff
--- a/mod_rest/jsonmap.lib.lua	Thu Nov 04 20:04:13 2021 +0100
+++ b/mod_rest/jsonmap.lib.lua	Thu Nov 04 20:13:43 2021 +0100
@@ -478,6 +478,7 @@
 		for k, implied in pairs(implied_types) do
 			if t[k] then
 				t_type = implied;
+				break;
 			end
 		end
 	end