This commit performs two related changes. First we adjust readCOOValue to take the IsPattern bool as a template parameter rather than a function argument. Second we factor readCOOLoop out from readCOO, and template it on IsPattern and IsSymmetric. Together this moves all the assertions and header-dependent conditionals out of the main for-loop of readCOO. The only remaining conditional is in the IsSymmetric=true variant: checking whether the element is on the diagonal or not (which cannot be lifted out of the loop).
Depends On D138363