From 4df4d1cf01b233412e88dd1486d8d49c3636dee2 Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 5 Dec 2001 12:10:59 +0000 Subject: [PATCH] Speedup: don't create a DocumentImpl and delete it right away (copy ctor and operator=) svn path=/trunk/kdelibs/; revision=125643 --- khtml/dom/html_document.cpp | 3 +-- khtml/dom/html_document.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/khtml/dom/html_document.cpp b/khtml/dom/html_document.cpp index 11f0ed5772..95ea234f81 100644 --- a/khtml/dom/html_document.cpp +++ b/khtml/dom/html_document.cpp @@ -71,8 +71,7 @@ HTMLDocument &HTMLDocument::operator = (const Node &other) impl = 0; return *this; } - Document d; - d = other; + Document d(other); if(!d.isHTMLDocument()) impl = 0; else diff --git a/khtml/dom/html_document.h b/khtml/dom/html_document.h index dcdbe4fa70..89790d9bc0 100644 --- a/khtml/dom/html_document.h +++ b/khtml/dom/html_document.h @@ -82,7 +82,7 @@ public: */ HTMLDocument(KHTMLView *parent); HTMLDocument(const HTMLDocument &other); - HTMLDocument(const Node &other) : Document() + HTMLDocument(const Node &other) : Document(false) {(*this)=other;} protected: HTMLDocument(HTMLDocumentImpl *impl); -- GitLab