{"push_id":2333714352,"size":1,"distinct_size":1,"ref":"refs/heads/use-strict-iterators","head":"44574c0508f45ae55cef007f8c2c25afe99a9a20","before":"92c5027fcd1f9f7e9a01eb5150ad5d96166fe279","commits":[{"sha":"44574c0508f45ae55cef007f8c2c25afe99a9a20","author":{"name":"Luís Pereira","email":"db4d8b64569a2baf9d9564f52be8c0638dedaba4@gmail.com"},"message":"Don't implicitly cast iterator to const_iterator\n\nIt prevents detachments:\nTo illustrate:\n\nQMap<QString, QString> map;\n/* code compiles and works fine but find() returns the non-const\n   QMap::iterator that detaches!\n*/\nQMap<QString, QString>::const_iterator it = map.find(\"girish\");\n\nbut also some subtle bugs:\n\nQHash<int, int> wrong;\nif (wrong.find(1) == wrong.cend()) {\n    qDebug() << \"Not found\";\n} else {\n    /* find() detached the container before cend() was called, so it\n       prints \"Found\"\n    */\n    qDebug() << \"Found\";\n}\n\nQHash<int, int> right;\nif (right.constFind(1) == right.cend()) {\n    qDebug() << \"Not found\"; // This is correct now !\n} else {\n    qDebug() << \"Found\";\n}\n\nEnforced by QT_STRICT_ITERATORS definition.","distinct":true,"url":"https://api.github.com/repos/luis-pereira/qBittorrent/commits/44574c0508f45ae55cef007f8c2c25afe99a9a20"}]}
{"actor":{"display_login":"luis-pereira"}}