So we don't need an expensive call to toString()
<rdar://problem/89084526>
Created attachment 454576 [details] Patch
Comment on attachment 454576 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=454576&action=review > Source/WebCore/platform/MIMETypeRegistry.cpp:402 > + auto result = mimeTypeForExtension(path.substring(position + 1).toString()); Seems we could go one step further and make mimeTypeForExtension() take a StringView too?
Comment on attachment 454576 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=454576&action=review >> Source/WebCore/platform/MIMETypeRegistry.cpp:402 >> + auto result = mimeTypeForExtension(path.substring(position + 1).toString()); > > Seems we could go one step further and make mimeTypeForExtension() take a StringView too? I thought about it and did not do it as it is a bigger/cross-platform change. I'll give it a try.
Created attachment 454679 [details] Patch
Comment on attachment 454679 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=454679&action=review r=me with fix. > Source/WebCore/platform/MIMETypeRegistry.cpp:402 > + auto result = mimeTypeForExtension(path.substring(position + 1).toString()); There should be no .toString() here.
Created attachment 454817 [details] Patch for landing
Committed r291341 (248480@main): <https://commits.webkit.org/248480@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 454817 [details].