Skip to content

Replace Array#| with Array#+

Yorick Peterse requested to merge seancaffery:remove-union into master

Created by: seancaffery

This is primarily for performance reasons. It yields around a 23% improvement on a file with 300 violations.

Here is a benchmark using readygo:

lint check ticket
  Baseline: |                                                X-                |
  Current:  |                                                                X-|
            0                                                           13.288 s

Baseline (with this change) is around 9.6s.

From my understanding this will not have an impact on functionality even though there can be duplicates in excludes. There may be a performance impact on the include? call but the improvement seems to be worth it.

Merge request reports