Title: [183663] trunk/Source/WebCore
Revision
183663
Author
dba...@webkit.org
Date
2015-04-30 19:40:34 -0700 (Thu, 30 Apr 2015)

Log Message

Clean up: Remove unnecessary runtime computation of string length
https://bugs.webkit.org/show_bug.cgi?id=144483

Reviewed by Joseph Pecoraro.

Following <http://trac.webkit.org/changeset/183649>, WebCore::fullyQualifiedInfoTableName()
computes strlen() of the first string literal as part of concatenating two string literals.
It is sufficient to use sizeof() - 1 instead of strlen() to compute the length of the first
string literal because the size of the string literal is known at compile time.

* Modules/webdatabase/DatabaseBackendBase.cpp:
(WebCore::fullyQualifiedInfoTableName):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (183662 => 183663)


--- trunk/Source/WebCore/ChangeLog	2015-05-01 01:56:32 UTC (rev 183662)
+++ trunk/Source/WebCore/ChangeLog	2015-05-01 02:40:34 UTC (rev 183663)
@@ -1,3 +1,18 @@
+2015-04-30  Daniel Bates  <daba...@apple.com>
+
+        Clean up: Remove unnecessary runtime computation of string length
+        https://bugs.webkit.org/show_bug.cgi?id=144483
+
+        Reviewed by Joseph Pecoraro.
+
+        Following <http://trac.webkit.org/changeset/183649>, WebCore::fullyQualifiedInfoTableName()
+        computes strlen() of the first string literal as part of concatenating two string literals.
+        It is sufficient to use sizeof() - 1 instead of strlen() to compute the length of the first
+        string literal because the size of the string literal is known at compile time.
+
+        * Modules/webdatabase/DatabaseBackendBase.cpp:
+        (WebCore::fullyQualifiedInfoTableName):
+
 2015-04-30  Dean Jackson  <d...@apple.com>
 
         Expose -apple-system as a font family

Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp (183662 => 183663)


--- trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp	2015-05-01 01:56:32 UTC (rev 183662)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp	2015-05-01 02:40:34 UTC (rev 183663)
@@ -97,7 +97,7 @@
     static std::once_flag onceFlag;
     std::call_once(onceFlag, []{
         strcpy(qualifiedName, qualifier);
-        strcpy(qualifiedName + strlen(qualifier), unqualifiedInfoTableName);
+        strcpy(qualifiedName + sizeof(qualifier) - 1, unqualifiedInfoTableName);
     });
 
     return qualifiedName;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to