| 294 | |
| 295 | namespace KDevelop { |
| 296 | void swap(IndexedString& a, IndexedString& b) noexcept |
| 297 | { |
| 298 | using std::swap; |
| 299 | |
| 300 | if (a.m_index == b.m_index) { |
| 301 | return; |
| 302 | } |
| 303 | swap(a.m_index, b.m_index); |
| 304 | |
| 305 | const bool aRc = shouldDoDUChainReferenceCounting(&a); |
| 306 | const bool bRc = shouldDoDUChainReferenceCounting(&b); |
| 307 | |
| 308 | if (aRc == bRc) { |
| 309 | return; |
| 310 | } |
| 311 | |
| 312 | auto noLongerRefCountedIndex = b.m_index; |
| 313 | auto newlyRefCountedIndex = a.m_index; |
| 314 | if (bRc) { |
| 315 | swap(noLongerRefCountedIndex, newlyRefCountedIndex); |
| 316 | } |
| 317 | deref(noLongerRefCountedIndex); |
| 318 | ref(newlyRefCountedIndex); |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | QUrl IndexedString::toUrl() const |