Explorar el Código

LibUnicode: Move the CodePointRangeComparator struct to a public header

Move it out of the generated code so that it may be used by the code
generator itself.
Timothy Flynn hace 1 año
padre
commit
cb128dcf75

+ 0 - 7
Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeData.cpp

@@ -979,13 +979,6 @@ struct CodePointComparator {
     }
 };
 
-struct CodePointRangeComparator {
-    constexpr int operator()(u32 code_point, CodePointRange const& range)
-    {
-        return (code_point > range.last) - (code_point < range.first);
-    }
-};
-
 struct BlockNameData {
     CodePointRange code_point_range {};
     @string_index_type@ display_name { 0 };

+ 7 - 0
Userland/Libraries/LibUnicode/CharacterTypes.h

@@ -22,6 +22,13 @@ struct CodePointRange {
     u32 last { 0 };
 };
 
+struct CodePointRangeComparator {
+    constexpr int operator()(u32 code_point, CodePointRange const& range)
+    {
+        return (code_point > range.last) - (code_point < range.first);
+    }
+};
+
 struct BlockName {
     CodePointRange code_point_range {};
     StringView display_name;