In CNullDriver.add_texture() the Textures array is appended then sorted. This takes significantly more time as the length of the array increases. Since Textures is always kept sorted it would be more efficient to use a sorted insert.
This method also fixes a TODO in CVideoModeList.addMode().
The attached patch is against 1.8.1
Sorry, we don't use STL in Irrlicht so far (aka algorithm).
Might change some day, but not before 1.9 release.