Title: [93945] trunk/Source/WebCore
Revision
93945
Author
[email protected]
Date
2011-08-27 14:12:25 -0700 (Sat, 27 Aug 2011)

Log Message

SQLiteStatement::getColumnText() could construct WTF::String result more efficiently.
https://bugs.webkit.org/show_bug.cgi?id=67090

Patch by Andreas Kling <[email protected]> on 2011-08-27
Reviewed by Darin Adler.

* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::getColumnText): Use sqlite3_column_bytes16()
to get the length of the column text without looking for the null terminator.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (93944 => 93945)


--- trunk/Source/WebCore/ChangeLog	2011-08-27 21:03:41 UTC (rev 93944)
+++ trunk/Source/WebCore/ChangeLog	2011-08-27 21:12:25 UTC (rev 93945)
@@ -1,3 +1,14 @@
+2011-08-27  Andreas Kling  <[email protected]>
+
+        SQLiteStatement::getColumnText() could construct WTF::String result more efficiently.
+        https://bugs.webkit.org/show_bug.cgi?id=67090
+
+        Reviewed by Darin Adler.
+
+        * platform/sql/SQLiteStatement.cpp:
+        (WebCore::SQLiteStatement::getColumnText): Use sqlite3_column_bytes16()
+        to get the length of the column text without looking for the null terminator.
+
 2011-08-07  Robert Hogan  <[email protected]>
 
         The child div element with position:absolute will overlap with its parent div when a 'break' element is present in between

Modified: trunk/Source/WebCore/platform/sql/SQLiteStatement.cpp (93944 => 93945)


--- trunk/Source/WebCore/platform/sql/SQLiteStatement.cpp	2011-08-27 21:03:41 UTC (rev 93944)
+++ trunk/Source/WebCore/platform/sql/SQLiteStatement.cpp	2011-08-27 21:12:25 UTC (rev 93945)
@@ -345,7 +345,7 @@
             return String();
     if (columnCount() <= col)
         return String();
-    return String(reinterpret_cast<const UChar*>(sqlite3_column_text16(m_statement, col)));
+    return String(reinterpret_cast<const UChar*>(sqlite3_column_text16(m_statement, col)), sqlite3_column_bytes16(m_statement, col) / sizeof(UChar));
 }
     
 double SQLiteStatement::getColumnDouble(int col)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to