Skip to content

Commit 0a67836

Browse files
committed
Lint: Fix Performance/TimesMap
1 parent 85b8c9a commit 0a67836

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/money/currency_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def to_s
310310

311311
it "is thread safe" do
312312
ids = []
313-
2.times.map { Thread.new { ids << described_class.new("USD").object_id } }.each(&:join)
313+
Array.new(2) { Thread.new { ids << described_class.new("USD").object_id } }.each(&:join)
314314
expect(ids.uniq.length).to eq(1)
315315
end
316316
end

spec/money_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@
889889
end
890890

891891
it "does not round rationals" do
892-
splits = 7.times.map { Rational(950, 6650) }
892+
splits = Array.new(7) { Rational(950, 6650) }
893893
moneys = Money.us_dollar(6650).allocate(splits)
894894
moneys.each do |money|
895895
expect(money.cents).to eq 950

0 commit comments

Comments
 (0)