Optimized code by replacing explicit loops with list comprehensions for efficiency.
Utilized generator expressions to reduce memory overhead during output process. ( Instead of a list of outputs and then joining them using "\n".join(), the new code uses a generator expression which reduce memory consumption, particularly when dealing with large messages and outputs. )
Pre-Submission Checklist (optional but appreciated):
[ ] ( Not needed and field for it ) I have included relevant documentation updates (stored in /docs)
Describe the changes you have made:
Optimized code by replacing explicit loops with list comprehensions for efficiency. Utilized generator expressions to reduce memory overhead during output process. ( Instead of a list of outputs and then joining them using "\n".join(), the new code uses a generator expression which reduce memory consumption, particularly when dealing with large messages and outputs. )
Pre-Submission Checklist (optional but appreciated):
docs/CONTRIBUTING.md
docs/ROADMAP.md
OS Tests (optional but appreciated):