Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
depmod: Read modules.order only once
The current code iterates through modules.order twice. First, it figures out how many lines exist. Then it iterates again to make sure that the first line has the lowest sort index, then ascending. Negative values make sure that the previously assigned positive values will be larger, i.e. modules in modules.order take precedence, then modules found in file system which were not listed in modules.order. This can be simplified by setting the initial sort index value to the lowest possible value needed, i.e. -depmod->modules.count. With this value, it is possible to iterate only once. Signed-off-by: Tobias Stoeckmann <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Link: #158 Signed-off-by: Lucas De Marchi <[email protected]>
- Loading branch information