qdoc: simplify Text::clear()


Use std::exchange() to fold three lines into one, with correct
sequencing, and drop the nulling of m_first, which is a dead store:
when the while loop exits, m_first _is_ nullptr, otherwise control
would have been re-entered the loop again.

Amends the start of the public history.

Pick-to: 6.12 6.11 6.8
Change-Id: I43b152a723b446db7bca0f963922a874e41d0d8a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Topi Reinio <topi.reinio@qt.io>
commit6df02e20dcb5d26728a6846ed26c48d279152e67
parentac4fa982adbeb8d0fc86361dcb820edd2fda8387
authorMarc Mutz <marc.mutz@qt.io>
committerMarc Mutz <marc.mutz@qt.io>
commit timeThu, 18 Jun 2026 12:27:18 +0000