Skip to content

Commit 4bafc33

Browse files
Update content-gen/src/backend/app.py
Accepting Copilot PR reviewer suggestion to use lambda functions Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 0f97563 commit 4bafc33

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

content-gen/src/backend/app.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,9 +1001,12 @@ async def generate():
10011001
if existing_text and old_name and new_name and old_name != new_name:
10021002
pat = re.compile(re.escape(old_name), re.IGNORECASE)
10031003
if isinstance(existing_text, dict):
1004-
existing_text = {k: pat.sub(new_name, v) if isinstance(v, str) else v for k, v in existing_text.items()}
1004+
existing_text = {
1005+
k: pat.sub(lambda _m: new_name, v) if isinstance(v, str) else v
1006+
for k, v in existing_text.items()
1007+
}
10051008
elif isinstance(existing_text, str):
1006-
existing_text = pat.sub(new_name, existing_text)
1009+
existing_text = pat.sub(lambda _m: new_name, existing_text)
10071010

10081011
updated_content = {
10091012
**existing_content,

0 commit comments

Comments
 (0)