You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 11, 2025. It is now read-only.
[REF]: core set_border: Improve performance, Fix index out of Range
1. **Variable Initialization**: We store `len(self.rows)` and `len(self.cols)` in `num_rows` and `num_cols` respectively to avoid recalculating these values on each iteration. 2. **Error Handling**: Before trying to set borders, we check if the number of rows and columns is valid. If either is zero, the method returns early. Additionally, we check if `self.cells` has the expected structure. If not, we raise a `ValueError`. 3. **Looping through Indices**: Instead of using `enumerate()`, use a simple `range()` loop since we only need the index and not the item itself. This can enhance readability and possibly performance.
0 commit comments