Squashed new RBAC
All checks were successful
Deploy on push / deploy (push) Successful in 7s

This commit is contained in:
2025-07-02 22:30:21 +03:00
parent 7585dae0ab
commit 82111ed0f6
100 changed files with 14785 additions and 5888 deletions

View File

@@ -27,19 +27,17 @@ def apply_diff(original: str, diff: list[str]) -> str:
Returns:
The modified string.
"""
result = []
pattern = re.compile(r"^(\+|-) ")
# Используем list comprehension вместо цикла с append
result = []
for line in diff:
match = pattern.match(line)
if match:
op = match.group(1)
content = line[2:]
if op == "+":
result.append(content)
elif op == "-":
# Ignore deleted lines
pass
result.append(line[2:]) # content
# Игнорируем удаленные строки (op == "-")
else:
result.append(line)