The layers are only scanned here and the features are collected in arrays, so it does not matter if e.g. casings are scanned before polygons. The order inside the arrays is kept stable.
I can see no visible difference with or without this patch, and from code inspection it looks like it should be equivalent. I'm just not sure why it wasn't done this way already, maybe it was just an oversight in cdb1121f.
The layers are only scanned here and the features are collected in arrays, so it does not matter if e.g. casings are scanned before polygons. The order inside the arrays is kept stable.
I can see no visible difference with or without this patch, and from code inspection it looks like it should be equivalent. I'm just not sure why it wasn't done this way already, maybe it was just an oversight in cdb1121f.