In general, Common.lua should be for functions that can be used on any table or number or other type. Many of these functions there are very specific to the GlobalCache. A few options I'd rather see
- Make the functions more generic (e.g. for
mergeDB here, have it be mergeTables and call it twice for conditions and multipliers)
- Move the functions to a separate file specifically for managing the GlobalCache (might be worth turning GlobalCache into a proper OO class potentially)
- Some of the functions are only used in one place. It might be better off having those functions in the file that uses them either as a local function or a function defined in that file instead of polluting the global namespace
Originally posted by @Wires77 in #2294 (comment)
In general,
Common.luashould be for functions that can be used on any table or number or other type. Many of these functions there are very specific to theGlobalCache. A few options I'd rather seemergeDBhere, have it bemergeTablesand call it twice for conditions and multipliers)Originally posted by @Wires77 in #2294 (comment)