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

Unified Diff: src/sfnt/SkOTTable_name.cpp

Issue 15070011: One SkTSearch to rule them all. Allow key to be of different type than the array. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fixes to compile on gcc Created 7 years, 7 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
« no previous file with comments | « src/gpu/gl/GrGLExtensions.cpp ('k') | src/utils/win/SkWGL_win.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/sfnt/SkOTTable_name.cpp
diff --git a/src/sfnt/SkOTTable_name.cpp b/src/sfnt/SkOTTable_name.cpp
index 0b309cd47d48c88367eb7e67f4e590e6deaf04d5..769a4240109ae8ac09cab40d19637e844eb1505b 100644
--- a/src/sfnt/SkOTTable_name.cpp
+++ b/src/sfnt/SkOTTable_name.cpp
@@ -431,8 +431,8 @@ BCP47FromLanguageID[] = {
};
namespace {
-int BCP47FromLanguageIdCompare(const BCP47FromLanguageId* a, const BCP47FromLanguageId* b) {
- return a->languageID - b->languageID;
+bool BCP47FromLanguageIdLess(const BCP47FromLanguageId& a, const BCP47FromLanguageId& b) {
+ return a.languageID < b.languageID;
}
}
@@ -509,7 +509,7 @@ bool SkOTTableName::Iterator::next(SkOTTableName::Iterator::Record& record) {
// Handle format 0 languages, translating them into BCP 47.
const BCP47FromLanguageId target = { languageID, "" };
- int languageIndex = SkTSearch<BCP47FromLanguageId, BCP47FromLanguageIdCompare>(
+ int languageIndex = SkTSearch<BCP47FromLanguageId, BCP47FromLanguageIdLess>(
BCP47FromLanguageID, SK_ARRAY_COUNT(BCP47FromLanguageID), target, sizeof(target));
if (languageIndex >= 0) {
record.language = BCP47FromLanguageID[languageIndex].bcp47;
« no previous file with comments | « src/gpu/gl/GrGLExtensions.cpp ('k') | src/utils/win/SkWGL_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698