Title: [183074] trunk/Source/WebCore
- Revision
- 183074
- Author
- [email protected]
- Date
- 2015-04-21 13:32:34 -0700 (Tue, 21 Apr 2015)
Log Message
Get rid of an unneeded function from LoaderNSURLExtras.mm
https://bugs.webkit.org/show_bug.cgi?id=144003
Reviewed by Chris Dumez.
Just use Vector::contains instead of vectorContainsString.
* loader/mac/LoaderNSURLExtras.mm:
(suggestedFilenameWithMIMEType):
(vectorContainsString): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (183073 => 183074)
--- trunk/Source/WebCore/ChangeLog 2015-04-21 20:23:50 UTC (rev 183073)
+++ trunk/Source/WebCore/ChangeLog 2015-04-21 20:32:34 UTC (rev 183074)
@@ -1,3 +1,16 @@
+2015-04-21 Anders Carlsson <[email protected]>
+
+ Get rid of an unneeded function from LoaderNSURLExtras.mm
+ https://bugs.webkit.org/show_bug.cgi?id=144003
+
+ Reviewed by Chris Dumez.
+
+ Just use Vector::contains instead of vectorContainsString.
+
+ * loader/mac/LoaderNSURLExtras.mm:
+ (suggestedFilenameWithMIMEType):
+ (vectorContainsString): Deleted.
+
2015-04-21 Chris Dumez <[email protected]>
Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
Modified: trunk/Source/WebCore/loader/mac/LoaderNSURLExtras.mm (183073 => 183074)
--- trunk/Source/WebCore/loader/mac/LoaderNSURLExtras.mm 2015-04-21 20:23:50 UTC (rev 183073)
+++ trunk/Source/WebCore/loader/mac/LoaderNSURLExtras.mm 2015-04-21 20:32:34 UTC (rev 183074)
@@ -40,15 +40,6 @@
using namespace WebCore;
-static bool vectorContainsString(const Vector<String>& vector, const String& string)
-{
- int size = vector.size();
- for (int i = 0; i < size; i++)
- if (vector[i] == string)
- return true;
- return false;
-}
-
NSString *suggestedFilenameWithMIMEType(NSURL *url, const String& mimeType)
{
// Get the filename from the URL. Try the lastPathComponent first.
@@ -83,7 +74,7 @@
if (mimeType != "application/octet-stream" && mimeType != "text/plain") {
Vector<String> extensions = MIMETypeRegistry::getExtensionsForMIMEType(mimeType);
- if (extensions.isEmpty() || !vectorContainsString(extensions, extension)) {
+ if (extensions.isEmpty() || !extensions.contains(String(extension))) {
// The extension doesn't match the MIME type. Correct this.
NSString *correctExtension = MIMETypeRegistry::getPreferredExtensionForMIMEType(mimeType);
if ([correctExtension length] != 0) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes