q2a/question2answer — pull request #30 by pupi1985 (2014-02-03 17:23:55+00:00)
Title: Some commits with minor improvements

I have a branch with a few minor improvements that I thought it would make sense to share.

The only one that may make sense to explain is 2b4c4d5b6a28001c180a4fcdb8dc4007685ff549. The idea is basically to avoid calling `qa_load_modules_with`, which calls `qa_list_modules($type)` which ends up calling `array_keys` too many times. I'd say it should be faster but I haven't benchmarked it. Anyway, it is more readable to have `qa_load_all_modules_with` function rather than having to iterate over them all.

Additionally, I thought that removing the global variable `$qa_modules` from functions that only read it would provide more encapsulation. I would even add items to it by a function encapsulating as much as possible, but as I mentioned before, I'm just throwing some ideas.