Bug 26778

Summary: Inspector: Duplicate Computation in Autocompletion
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web Inspector (Deprecated)Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, eric
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
Removed Duplicate Computation
none
Removed Duplicate Computation
mjs: review+
Removed Duplicate Computation (patch from root) joepeck: review-

Joseph Pecoraro
Reported 2009-06-27 19:49:10 PDT
It looks like there is an unnecessary duplicated computation of a text range in the TextPrompt's autocompletion feature. Lines 152 and 162 are identical. The result from 152 is passed into the function and available at the point 162 does the same calculation: http://trac.webkit.org/browser/trunk/WebCore/inspector/front-end/TextPrompt.js?rev=45315#L150
Attachments
Removed Duplicate Computation (1.83 KB, patch)
2009-06-27 19:55 PDT, Joseph Pecoraro
no flags
Removed Duplicate Computation (1.89 KB, patch)
2009-06-27 19:57 PDT, Joseph Pecoraro
mjs: review+
Removed Duplicate Computation (patch from root) (1.93 KB, patch)
2009-07-06 14:06 PDT, Joseph Pecoraro
joepeck: review-
Joseph Pecoraro
Comment 1 2009-06-27 19:55:17 PDT
Created attachment 31984 [details] Removed Duplicate Computation This removed the computation from inside the called function. Alternatively the computation could be removed from the calling function (line 152) and the parameter removed.
Joseph Pecoraro
Comment 2 2009-06-27 19:57:32 PDT
Created attachment 31985 [details] Removed Duplicate Computation Better ChangeLog (link to the bug).
Maciej Stachowiak
Comment 3 2009-07-05 04:26:47 PDT
Comment on attachment 31985 [details] Removed Duplicate Computation Looks good to me. I am surprised at the duplication but it certainly looks like the passed in originalWordPrefixRange is computed in an identical way, and can't have changed by the time _completionsReady is reached.
Eric Seidel (no email)
Comment 4 2009-07-06 13:45:28 PDT
The patch is from within WebCore, so bugzilla-tool fails to apply it. https://bugs.webkit.org/show_bug.cgi?id=26999
Joseph Pecoraro
Comment 5 2009-07-06 13:59:50 PDT
I did the same as my last patch, which seemed to apply fine: https://bugs.webkit.org/show_bug.cgi?id=26489 Is this due to the Bugzilla upgrade? Should I go to the root and run "svn-create-patch" instead?
Eric Seidel (no email)
Comment 6 2009-07-06 14:01:24 PDT
It will apply fine. :) I just can't do it from bugzilla-tool, because bugzilla-tool assumes patches are made from the root. Someone can manually land this no problem.
Joseph Pecoraro
Comment 7 2009-07-06 14:06:27 PDT
Created attachment 32316 [details] Removed Duplicate Computation (patch from root) Removed Duplicate Computation - svn-create-patch made from the root directory.
Brent Fulgham
Comment 8 2009-07-12 20:56:05 PDT
Joseph Pecoraro
Comment 9 2009-07-14 05:53:29 PDT
Since the patch landed I removed the (patch from root) from the review queue. Cheers.
Note You need to log in before you can comment on or make changes to this bug.