Board Thread:Support Requests - Getting Technical/@comment-4189499-20150223091515

Hi all.

There is a template on the Candy Crush Saga Wiki which is used often but is based on a very large and therefore very expensive #switch function. By very large, I mean almost 1,500 arguments long, and expanding as new content is released for the game. Now, normally this isn't a problem and works fine on normal pages when the template is used once or maybe twice, but on a page such as List of Levels where the template is used hundreds of times to show the difficulty of each level, it really slows the page down and I believe it is the main cause of the node count limit error.

What I want to know is if this template can be replaced by a Lua module and if that would be faster to load on a page. I'm guessing that a similar result to the original template could be achieved by using a Lua table where the level is the key and the difficulty is the value, but I don't know how to write a script like that. If a Lua module like that would be faster to load than the original template, could somebody please start off a module for me and then tell me how to finish it? Thanks so much in advance for your help! 