A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/rubocop/rubocop/issues/14249 below:

`Style/RedundantArrayFlatten` can be unsafe when the `Array` contains empty `Array`s and `join` uses a separator · Issue #14249 · rubocop/rubocop · GitHub

> ['a', [], 'b'].flatten.join("\n")
=> "a\nb"

got corrected to:

> ['a', [], 'b'].join("\n")
=> "a\n\nb"

which is a different result. Should be mentioned in the docs, at least.

1.76.0 (using Parser 3.3.8.0, Prism 1.4.0, rubocop-ast 1.45.0, analyzing as Ruby 3.4, running on ruby 3.4.2) [x86_64-linux]
  - rubocop-rails 2.32.0
  - rubocop-minitest 0.38.1
  - rubocop-performance 1.25.0
  - rubocop-capybara 2.22.1

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4