contact: place no lent lines when nothing outside a note is lent
lent_at copied every line of the stored and the served card before
finding that most contacts have nothing to place.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GNVLyiMrZJ7sZctEYq6WCM
diff --git a/lib/pro_tacts/contact.rb b/lib/pro_tacts/contact.rb
index c11c1b3..d78946d 100644
--- a/lib/pro_tacts/contact.rb
+++ b/lib/pro_tacts/contact.rb
@@ -400,8 +400,12 @@ module ProTacts
def lent_at
return @lent_at if defined?(@lent_at)
- remaining = @stored.lines.map { it.verbatim.chomp }.tally
rows = @inherited.reject { note_row?(it.line) } #: Array[Contact::Inherited]
+ # Nothing lent outside a note is nothing to place, and the walk
+ # below copies every line of both cards to find that out.
+ return @lent_at = {} if rows.empty?
+
+ remaining = @stored.lines.map { it.verbatim.chomp }.tally
@lent_at = {} #: Hash[Integer, Group]
vcard.lines.each_with_index do |served, index|
next if served.names?("NOTE")