Improve performance of ligature component matching This O(N^2) was introduced in 8b2c94c43fd335b944d5e5487265706b8e0f9041. Make it O(N).