Use QDate as key in mIncidencesForDate in MemoryCalendar
ClosedPublic

Authored by dvratil on Nov 6 2019, 10:52 AM.

Details

Summary

Avoids unnecessary conversions from QDate to QString, since QDate does
have a qHash() function in Qt5. Also might save some bytes per each event
as QDate is more lightweight than storing a QString representation of a
date.

Diff Detail

Branch
memorycalendar-qdate-hash
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18528
Build 18546: arc lint + arc unit
dvratil requested review of this revision.Nov 6 2019, 10:52 AM
dvratil created this revision.
ognarb added a subscriber: ognarb.Nov 6 2019, 2:34 PM
ognarb added inline comments.
src/memorycalendar.cpp
108

Documentation needs to be updated

vkrause accepted this revision.Nov 7 2019, 8:13 AM

Ouch, good find! Might even make sense to turn this from QMap<IncidenceBase::IncidenceType, QMultiHash<QDate, IncidenceBase::Ptr>> into QMultiHash<QDate, Incidence::Ptr>[4] in a second step.

This revision is now accepted and ready to land.Nov 7 2019, 8:13 AM
dvratil closed this revision.Nov 12 2019, 12:39 PM