Use QDate as key in mIncidencesForDate in MemoryCalendar
ClosedPublic

Authored by dvratil on Wed, Nov 6, 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.Wed, Nov 6, 10:52 AM
dvratil created this revision.
ognarb added a subscriber: ognarb.Wed, Nov 6, 2:34 PM
ognarb added inline comments.
src/memorycalendar.cpp
108

Documentation needs to be updated

vkrause accepted this revision.Thu, Nov 7, 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.Thu, Nov 7, 8:13 AM
dvratil closed this revision.Tue, Nov 12, 12:39 PM