Inlined threshold checking