cr:823078 - refactored include dirs processing code to improve runtime p...

...erformance