Drop "get" prefix from SQLiteStatement member functions as well as out-parameters.
Created attachment 429056 [details] Patch
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment on attachment 429056 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429056&action=review > Source/WebCore/platform/sql/SQLiteStatement.cpp:287 > + Vector<uint8_t> result; I think we should declare this later and just return { } in earlier return statements. > Source/WebCore/platform/sql/SQLiteStatement.cpp:304 > + result.resize(static_cast<size_t>(blobSize)); > + memcpy(result.data(), blob, static_cast<size_t>(blobSize)); > + return result; To construct a vector with a copy of the data, we shouldn’t use resize. I wish there was a suitable Vector constructor so you could write this: return { blob, static_cast<size_t>(blobSize) }; But instead we need to write this: Vector<uint8_t> result; result.reserveInitialCapacity(blobSize); result.append(blob, blobSize); return result; Also maybe we should consider having this return FixedVector in the future?
Created attachment 429083 [details] Patch
(In reply to Darin Adler from comment #3) > Comment on attachment 429056 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=429056&action=review > > > Source/WebCore/platform/sql/SQLiteStatement.cpp:287 > > + Vector<uint8_t> result; > > I think we should declare this later and just return { } in earlier return > statements. Done. > > Source/WebCore/platform/sql/SQLiteStatement.cpp:304 > > + result.resize(static_cast<size_t>(blobSize)); > > + memcpy(result.data(), blob, static_cast<size_t>(blobSize)); > > + return result; > > To construct a vector with a copy of the data, we shouldn’t use resize. I > wish there was a suitable Vector constructor so you could write this: > > return { blob, static_cast<size_t>(blobSize) }; I added this new Vector constructor and an API test for it.
Committed r277750 (237920@main): <https://commits.webkit.org/237920@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 429083 [details].
<rdar://problem/78223453>