!215 fix: Sortlink, the response time to insert the node should be inserted into the back of the existing node.
Merge pull request !215 from zhushengle/sortlink
This commit is contained in:
commit
41f207516e
|
@ -55,10 +55,14 @@ STATIC INLINE VOID OsAddNode2SortLink(SortLinkAttribute *sortLinkHeader, SortLin
|
||||||
}
|
}
|
||||||
|
|
||||||
SortLinkList *listSorted = LOS_DL_LIST_ENTRY(head->pstNext, SortLinkList, sortLinkNode);
|
SortLinkList *listSorted = LOS_DL_LIST_ENTRY(head->pstNext, SortLinkList, sortLinkNode);
|
||||||
if (listSorted->responseTime >= sortList->responseTime) {
|
if (listSorted->responseTime > sortList->responseTime) {
|
||||||
LOS_ListAdd(head, &sortList->sortLinkNode);
|
LOS_ListAdd(head, &sortList->sortLinkNode);
|
||||||
sortLinkHeader->nodeNum++;
|
sortLinkHeader->nodeNum++;
|
||||||
return;
|
return;
|
||||||
|
} else if (listSorted->responseTime == sortList->responseTime) {
|
||||||
|
LOS_ListAdd(head->pstNext, &sortList->sortLinkNode);
|
||||||
|
sortLinkHeader->nodeNum++;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOS_DL_LIST *prevNode = head->pstPrev;
|
LOS_DL_LIST *prevNode = head->pstPrev;
|
||||||
|
|
Loading…
Reference in New Issue