mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-02-11 19:09:43 +08:00
1a913c502b
Explicit or implicit calls to begin() and end() cause a non-const container to detach from shared data, ie. to perform a deep-copy to gain a unique copy of the data. That can be a expensive although unneeded operation. In order to assist the developer a copyAsConst function is added. copyAsConst returns a const copy of the object. For lvalues just use qAsConst. It's only available on Qt 5.7.0. But we added also for earlier versions. The developer can always use qAsConst. Intended uses: QString s = ...; for (const auto &ch : qAsConst(s)) process(ch); for (const auto &ch : copyAsConst(funcReturningQString())) process(ch); |
||
---|---|---|
.. | ||
app | ||
base | ||
gui | ||
icons | ||
lang | ||
searchengine | ||
webui | ||
CMakeLists.txt | ||
config.h.cmakein | ||
icons.qrc | ||
lang.qrc | ||
qbittorrent_file.ico | ||
qbittorrent_mingw.rc | ||
qbittorrent.exe.manifest | ||
qbittorrent.ico | ||
qbittorrent.rc | ||
searchengine.qrc | ||
src.pro | ||
update_qrc_files.py |