Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix variable shadowing in getDelegations #1644

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

mdqst
Copy link
Contributor

@mdqst mdqst commented Dec 1, 2024

In the provided code, there was a potential issue with variable shadowing in the getDelegations function. Specifically, the parameter addresses was used as the name of the array and then reused inside the map method, which could lead to confusion. This issue was fixed by renaming the inner variable in the map method.

The error:

const addressesLc = addresses.map((addresses) => addresses.toLowerCase());

The fix:

const addressesLc = addresses.map((address) => address.toLowerCase());

This change improves code readability and prevents potential bugs related to variable shadowing, ensuring that the code is easier to maintain and understand.

@ChaituVR ChaituVR merged commit 84e5e8b into snapshot-labs:master Dec 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants