Make code in suppress_warnings.rb more concise

While looking at this code, made the method more concise.