path: root/src/corelib/tools/qdatetime.h
diff options
authorThiago Macieira <>2015-01-14 16:57:21 -0800
committerThiago Macieira <>2015-04-07 14:48:47 +0000
commit22dbf6111ddbbf7e692157f7f7eacaf776013ac0 (patch)
tree2372ee0f80aa8ae475ce66604709fd60621453dd /src/corelib/tools/qdatetime.h
parent2a6249c00ad66e7b670acb18d4b1eec7508ac3d9 (diff)
Remove unnecessary QDateTime::detach() function
Last commit changed QDateTime::d to be a QSharedDataPointer that implicitly detaches on non-const operator->() calls. That means we no longer need to explicitly call detach(). More than that, we should not do it, so we avoid checking the ref count and try to detach on every use. To do that, in functions where the d pointer was accessed more than once, I detach at the top and shadow the "d" variable with a local plain pointer. We don't compile our sources with -Wshadow, so this should not be a problem. Change-Id: Ic5d393bfd36e48a193fcffff13b969c281c36d0c Reviewed-by: Lars Knoll <>
Diffstat (limited to 'src/corelib/tools/qdatetime.h')
1 files changed, 0 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index 88288872df..78ec2b156a 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -321,7 +321,6 @@ public:
friend class QDateTimePrivate;
- void detach();
// ### Qt6: Using a private here has high impact on runtime
// on users such as QFileInfo. In Qt 6, the data members