3 ms·
Maybe something like a hash table/array could be used, predefined with the key being the URL and the value being the config, then the function could do somethin
by cr0sh 7y ago
Maybe something like a hash table/array could be used, predefined with the key being the URL and the value being the config, then the function could do something like return the value from the array given the key, with some kind of logic to return the unknown config by default if the key wasn't in the array (this would all depend on the language - it could be that such a method might be worse for readability; it would also depend on if the array could be defined elsewhere as an included file/module or something, etc).