sched-ext / scx

sched_ext schedulers and tools
https://bit.ly/scx_slack
GNU General Public License v2.0
691 stars 48 forks source link

scx_utils: Utilize Entry API for BTreeMap insertion #372

Closed vax-r closed 2 weeks ago

vax-r commented 2 weeks ago

Summary

Take advantages of BTreeMap's Entry API working with or_insert() to do the conditional insertion. Insert only when the entry doesn't exist. Doing so can reduce the amount of code and provide better readability and perform in-place manipulation.

Reference