InfiniTimeOrg / InfiniTime

Firmware for Pinetime smartwatch written in C++ and based on FreeRTOS
GNU General Public License v3.0
2.64k stars 907 forks source link

Add StaticVector for NotificationManager #1712

Closed Riksu9000 closed 6 months ago

Riksu9000 commented 1 year ago

Apart from renaming some public functions to reduce ambiguity, this does not change the behavior of the class IndexOf won't return an invalid index anymore, so there are minor differences in (unused) edge cases Reverted so Get() can return an empty notification if the id is invalid.. Using a vector-like class makes it so the newest element has the highest index, whereas before At(0) was the newest entry. A new function was added to get the position of the notification where 0 is the newest one, to imitate the behavior of the old previously public IndexOf() function.

github-actions[bot] commented 1 year ago
Build size and comparison to main: Section Size Difference
text 406244B -244B
data 940B 0B
bss 53552B -8B