WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
144483
Clean up: Remove unnecessary runtime computation of string length
https://bugs.webkit.org/show_bug.cgi?id=144483
Summary
Clean up: Remove unnecessary runtime computation of string length
Daniel Bates
Reported
2015-04-30 18:27:37 PDT
Following <
http://trac.webkit.org/changeset/183649
>, WebCore::fullyQualifiedInfoTableName() computes the strlen() of a string literal as part of concatenating two string literals. Notice that the size of a string literal is known at compile time. It is sufficient to use sizeof() - 1 instead of strlen() to compute the string length of the string literal.
Attachments
Patch
(1.79 KB, patch)
2015-04-30 18:29 PDT
,
Daniel Bates
joepeck
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Daniel Bates
Comment 1
2015-04-30 18:29:16 PDT
Created
attachment 252127
[details]
Patch
Joseph Pecoraro
Comment 2
2015-04-30 19:39:04 PDT
Comment on
attachment 252127
[details]
Patch r=me
Daniel Bates
Comment 3
2015-04-30 19:41:51 PDT
Committed
r183663
: <
http://trac.webkit.org/changeset/183663
>
Darin Adler
Comment 4
2015-05-01 12:03:24 PDT
Comment on
attachment 252127
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=252127&action=review
> Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp:100 > - strcpy(qualifiedName + strlen(qualifier), unqualifiedInfoTableName); > + strcpy(qualifiedName + sizeof(qualifier) - 1, unqualifiedInfoTableName);
This change is unnecessary for clang or gcc since they already constant-fold this. So in practice this is a at most a Windows-only optimization.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug