~gpcf/advtrains-devel

Simplify codes... yay v1 PROPOSED

1F616EMO: 1
 Simplify codes... yay

 1 files changed, 1 insertions(+), 9 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~gpcf/advtrains-devel/patches/54929/mbox | git am -3
Learn more about email & git

[PATCH] Simplify codes... yay Export this patch

From: 1F616EMO <root@1f616emo.xyz>

---
 advtrains/wagons.lua | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/advtrains/wagons.lua b/advtrains/wagons.lua
index 536c8d4..a9f2562 100644
--- a/advtrains/wagons.lua
+++ b/advtrains/wagons.lua
@@ -16,15 +16,7 @@ advtrains.wagons = {}
advtrains.wagon_alias = {}
advtrains.wagon_prototypes = setmetatable({}, {
	__index = function(t, k)
		local rtn_val = rawget(t, k)
		if rtn_val ~= nil then
			return rtn_val
		end
		local alias = advtrains.wagon_alias[k]
		if alias then
			return rawget(t, alias)
		end
		return nil
		return rawget(t, advtrains.wagon_alias[k])
	end
})
advtrains.wagon_objects = {}
-- 
2.46.0
Sorry for not seeing y5nw's suggestions soon enough. This patch applies 
the suggested optimizations.