Code Optimization

This commit is contained in:
Kioubit 2021-12-24 16:58:44 -05:00
parent 2dde03d5c4
commit a1d77463da

View File

@ -162,12 +162,16 @@ func getAddressFromQuestionListRetry(targetIP []byte, ndpQuestionChan chan *ndpQ
if success {
return result, true
}
select {
case q := <-ndpQuestionChan:
ndpQuestionsList = append(ndpQuestionsList, q)
default:
return nil, false
forloop:
for {
select {
case q := <-ndpQuestionChan:
ndpQuestionsList = append(ndpQuestionsList, q)
default:
break forloop
}
}
result, success = getAddressFromQuestionList(targetIP, ndpQuestionsList)
return result, success
}