Simplify Shape#_contains() code.