The ".sdk" component is usually the last one in the -isysroot, so it makes more sense to scan from the back. Also, technically, someone could install Xcode into a directory ending with .sdk, which would break this heuristic.
@JDevlieghere it's an annoying bug in Phab, but if you approve a patch without providing any textual message, Phab doesn't send email to the mailing list - so it ends up looking like something's committed without approval (if you're just looking at the mailing list). So if possible, please include a message ("Thanks", "Looks good!" etc) when approving patches with Phab.