Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const QByteArray SEP = ": ";
- const QByteArray NEWLINE = "\r\n";
- QMap<QString, QString> m_Values;
- void QAmiPropertyMap::convertStr(const QByteArray &str)
- {
- QStringList lines = QString(str).split(NEWLINE);
- for(const auto &s : lines) {
- int cutAt = s.indexOf(SEP);
- QStringRef key = s.leftRef(cutAt);
- QStringRef value = s.rightRef(s.length() - cutAt - SEP.length());
- //qDebug() << "KEY: "<< key << " VALUE: "<<value;
- m_Values.insert(*key.string(), *value.string());
- }
- }
- Elapsed time: 427 ms
- One cycle: 1.423333 ms
- Create item: 0.006590 ms
- Items: 216
- Create count (300x216): 64800
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement