Every time a content object is created we create an nsAutoString that's only used when creating textarea's, this can be avoided and we'd shave off the over head of creating (and destroying) the nsAutoString object for ever content object that's created. Patch coming up.
Created attachment 106726 [details] [diff] [review] Don't create an nsAutoString every time we create a content object.
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: [HAVE FIX]
Target Milestone: --- → mozilla1.3alpha
Comment on attachment 106726 [details] [diff] [review] Don't create an nsAutoString every time we create a content object. >+ nsCOMPtr<nsIDOMHTMLTextAreaElement> ta(do_QueryInterface(*aResult)); >+ NS_ASSERTION(ta, "Huh? text area doesn't implement " >+ "nsIDOMHTMLTextAreaElement?"); >+ >+ ta->SetDefaultValue(Substring(start, end)); You've null check here. no? r=harishd
Attachment #106726 - Flags: review?(harishd) → review+
I decided that the null check was not necessary at that point, we'll never create textarea elements that don't implement nsIDOMHTMLTextAreaElement, if we start doing that, we'll find out soon enough from the assertion. If someone disagrees with me I can add back the null check, but IMNSHO the check is code-bloat we can well live w/o.
16 years ago
Attachment #106726 - Flags: superreview?(heikki) → superreview+
Status: ASSIGNED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
Looking at the patch, a question arised: If the 'skippedContent' is just a CRLF (or CR or LF), then it is not empty, but after skipping the initial CRLF, it becomes empty. Could this happen a lot?, and if so could it save even more by also shaving an nsAutoString for just a 'CRLF' string?
You need to log in before you can comment on or make changes to this bug.