diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp
index 0e46cb180c6..4df8f95e630 100644
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -7213,7 +7213,7 @@ HTMLInputElement::SetFilePickerFiltersFromAccept(nsIFilePicker* filePicker)
filterBundle->GetStringFromName(MOZ_UTF16("videoFilter"),
getter_Copies(extensionListStr));
} else if (token.First() == '.') {
- if (token.FindChar(';') >= 0 || token.FindChar('*') >= 0) {
+ if (token.Contains(';') || token.Contains('*')) {
// Ignore this filter as it contains reserved characters
continue;
}
diff --git a/xpcom/string/nsTSubstring.h b/xpcom/string/nsTSubstring.h
index 6bc4e358d8f..d333f2ff3a4 100644
--- a/xpcom/string/nsTSubstring.h
+++ b/xpcom/string/nsTSubstring.h
@@ -283,6 +283,10 @@ public:
size_type NS_FASTCALL CountChar(char_type) const;
int32_t NS_FASTCALL FindChar(char_type, index_type aOffset = 0) const;
+ inline bool Contains(char_type aChar) const
+ {
+ return FindChar(aChar) != kNotFound;
+ }
/**
* equality