While digging through content.module I found an unnecessary looping, sort of like this:
foreach (module_list() as $module) {
// Some code.
}
foreach (module_list() as $module) {
// More code.
}
This patch simply makes it:
foreach (module_list() as $module) {
// Some code.
// More code.
}
I couldn't find any reason for the two separate loops, the variable names are never over written or anything.
| Comment | File | Size | Author |
|---|---|---|---|
| content_remove_foreach.patch | 617 bytes | quicksketch |
Comments
Comment #1
yched commentedTrue, I've been having this as a TODO for at least 2 months...
Committed !
Comment #2
yched commentedActually I reverted this, this broke the addition of formatters by external modules (e.g imagecache implementing formatters for imagefields - see http://drupal.org/node/157176#comment-807421). $info['field types'][$db_name]['formatters'] entries were overwritten by $info['field types'][$db_name]['formatters'] = array(); at the beginning of the next iteration.
Comment #3
yched commentedI just refactored that area a little bit, and added comments to help us resist the temptation later on.