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

clear mdns.queryservice()'s previous result when called #4894

Merged
merged 4 commits into from
Jul 6, 2018

Conversation

a-c-sreedhar-reddy
Copy link
Contributor

No description provided.

@d-a-v d-a-v changed the title issue #4893 clear mdns.queryservice()'s previous result when called Jul 5, 2018

MDNSAnswer *answer;
int numAnswers = _getNumAnswers();
for (int n = numAnswers - 1; n >= 0; n--) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Answers is implemented as a linked list. This implementation will search the linked list from front to back for each iteration in order to find the last one for removal, which is an exponential algorithm.
Could you please reimplement the clearing of the answers by just iterating through the list and freeing each?

@devyte devyte self-assigned this Jul 5, 2018
@devyte devyte merged commit e0b6242 into esp8266:master Jul 6, 2018
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