Skip to content

Commit

Permalink
Cut 1.13.3
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Mar 5, 2022
1 parent 3f5c024 commit abe22de
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## master (unreleased)

## 1.13.3 (2022-03-05)

### Bug fixes

* [#285](https://github.com/rubocop/rubocop-performance/pull/285): Fix an error for `Performance/MapCompact` when using `map(&:do_something).compact.first` and there is a line break after `map.compact` and receiver. ([@ydah][])
Expand Down
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ name: rubocop-performance
title: RuboCop Performance
# We always provide version without patch here (e.g. 1.1),
# as patch versions should not appear in the docs.
version: 'master'
version: '1.13'
nav:
- modules/ROOT/nav.adoc
12 changes: 4 additions & 8 deletions docs/modules/ROOT/pages/cops_performance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,9 @@ str.casecmp('ABC').zero?
| -
|===

This cop is used to identify usages of
Each of these methods (`compact`, `flatten`, `map`) will generate a
new intermediate array that is promptly thrown away. Instead it is
faster to mutate when we know it's safe.
This cop is used to identify usages of `array.compact.flatten.map { |x| x.downcase }`.
Each of these methods (`compact`, `flatten`, `map`) will generate a new intermediate array
that is promptly thrown away. Instead it is faster to mutate when we know it's safe.

=== Examples

Expand All @@ -347,11 +346,8 @@ faster to mutate when we know it's safe.
# bad
array = ["a", "b", "c"]
array.compact.flatten.map { |x| x.downcase }
----
[source,ruby]
----
# good.
# good
array = ["a", "b", "c"]
array.compact!
array.flatten!
Expand Down
2 changes: 1 addition & 1 deletion lib/rubocop/performance/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module RuboCop
module Performance
# This module holds the RuboCop Performance version information.
module Version
STRING = '1.13.2'
STRING = '1.13.3'

def self.document_version
STRING.match('\d+\.\d+').to_s
Expand Down
5 changes: 5 additions & 0 deletions relnotes/v1.13.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Bug fixes

* [#285](https://github.com/rubocop/rubocop-performance/pull/285): Fix an error for `Performance/MapCompact` when using `map(&:do_something).compact.first` and there is a line break after `map.compact` and receiver. ([@ydah][])

[@ydah]: https://github.com/ydah

0 comments on commit abe22de

Please sign in to comment.