File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -246,20 +246,17 @@ inline bool ISyncObject::Tick(Timeout elapsed_ticks)
246246// ! Implementation of ISyncObject::Tick, see \a ISyncObject. Placed here as it depends on \a GetUserTaskFromTid.
247247inline Weight ISyncObject::FindWeightHigherThan (Weight comp) const
248248{
249- Weight result = NO_WEIGHT;
249+ Weight max_weight = NO_WEIGHT;
250250
251251 for (const IWaitObject *itr = static_cast <IWaitObject *>(m_wait_list.GetFirst ()); (itr != nullptr );
252252 itr = static_cast <IWaitObject *>(itr->GetNext ()))
253253 {
254254 Weight w = GetUserTaskFromTid (itr->GetTid ())->GetWeight ();
255- if (w > comp)
256- {
257- result = w;
258- break ;
259- }
255+ if (w > max_weight)
256+ max_weight = w;
260257 }
261258
262- return result ;
259+ return ((max_weight > comp) ? max_weight : NO_WEIGHT) ;
263260}
264261
265262// ! Implementation of ITask::GetId, see \a ITask. Placed here as it depends on \a GetTidFromUserTask.
You can’t perform that action at this time.
0 commit comments