Quick fix for perf regression in adding constraints