refactor: fix has_bangs initialization and use |= operator

This commit is contained in:
Paul Gauthier (aider) 2024-12-01 07:54:44 -08:00
parent 60f2da370f
commit 9a5925b1ad

View file

@ -172,12 +172,12 @@ class FileWatcher:
# Refresh all AI comments from tracked files
ai_comments = {}
#ai has_bangs should be False and |= !
has_bangs = False
for fname in self.coder.abs_fnames:
line_nums, comments, has_bang = self.get_ai_comments(fname)
if line_nums:
ai_comments[fname] = comments
has_bangs = has_bang
has_bangs |= has_bang
if not has_bangs:
return ""