Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Unified Diff: third_party/WebKit/Source/platform/fonts/UnicodeRangeSet.cpp

Issue 1806653002: Shape unicode-range: font faces in only one iteration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update UnicodeRangeSetTests to RefPtrtr, rm copy constructor and test Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/fonts/UnicodeRangeSet.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/UnicodeRangeSet.cpp b/third_party/WebKit/Source/platform/fonts/UnicodeRangeSet.cpp
index 309c50a33c2bdd0b6083f56600038a444a32f207..6dbac82de749dd39df31df0799dd0122ede351e4 100644
--- a/third_party/WebKit/Source/platform/fonts/UnicodeRangeSet.cpp
+++ b/third_party/WebKit/Source/platform/fonts/UnicodeRangeSet.cpp
@@ -62,15 +62,6 @@ bool UnicodeRangeSet::contains(UChar32 c) const
return it != m_ranges.end() && it->contains(c);
}
-bool UnicodeRangeSet::contains(const FontDataRange& range) const
-{
- for (auto it = m_ranges.begin(); it != m_ranges.end(); ++it) {
- if (*it == range)
- return true;
- }
- return false;
-}
-
bool UnicodeRangeSet::intersectsWith(const String& text) const
{
if (text.isEmpty())
@@ -90,4 +81,17 @@ bool UnicodeRangeSet::intersectsWith(const String& text) const
return false;
}
+bool UnicodeRangeSet::operator==(const UnicodeRangeSet& other) const
+{
+ if (m_ranges.size() == 0 && other.size() == 0)
+ return true;
+ if (m_ranges.size() != other.size()) {
+ return false;
+ }
+ bool equal = true;
+ for (size_t i = 0; i < m_ranges.size(); ++i) {
+ equal = equal && m_ranges[i] == other.m_ranges[i];
+ }
+ return equal;
+}
}

Powered by Google App Engine
This is Rietveld 408576698