```ruby
class Hash

  # Remove nil and empty keys.
  def compact
    delete_if { |key, value| value.blank? }
  end

end
```

Remove useless comment, code is actually the comment
user
```ruby
class Hash

  def compact
    delete_if { |key, value| value.blank? }
  end

end
```
assistant