Skip to content

Commit a3359dc

Browse files
pftgclaude
andcommitted
perf: memoize Difference#region_area_size
Called from blank?, to_h, and tolerable? — avoid recomputing each time. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 33604be commit a3359dc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/capybara/screenshot/diff/difference.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def blank?
6363
end
6464

6565
def region_area_size
66-
region&.size || 0
66+
@region_area_size ||= region&.size || 0
6767
end
6868

6969
def ratio

0 commit comments

Comments
 (0)