mt-mods / signs_lib

Other
4 stars 12 forks source link

Fix some warnings from #3 #4

Closed syimyuzya closed 2 years ago

syimyuzya commented 2 years ago

In #3:

https://github.com/mt-mods/signs_lib/blob/3f1a8fa3f25a17bc33f700bb249627d3f11c7f8d/encoding.lua#L281

@syimyuzya what is intended with those assignments? Should both variables be assigned the value, or only one?

This piece of code existed before my modification, It is equivalent to (and should be written as) r, scope = r .. scope, nil.

I immitated this style at first in my code, writing j, l, u = nil four times. Didn't realize that this is not actually a good practice in Lua. This can be fixed by changing to just j = nil (l and u not read when j is nil).

OgelGames commented 2 years ago

Ah, thanks :)