Project

General

Profile

Actions

Refactor #37287

closed

Iterate on hashes when both key and value are used

Added by Ewoud Kohl van Wijngaarden about 2 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Category:
Performance
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

In various places we have patterns like hash.keys.each { |k| hash[k] } (or with .keys.sort). It's better to replace this with hash.each { |k, v| } to avoid lookups.

Actions

Also available in: Atom PDF