فهرست منبع

LibGfx: Do not use double negation in TIFFGenerator.py

No behavior change.
Nico Weber 1 سال پیش
والد
کامیت
80359517bd
1فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 3 3
      Userland/Libraries/LibGfx/TIFFGenerator.py

+ 3 - 3
Userland/Libraries/LibGfx/TIFFGenerator.py

@@ -192,10 +192,10 @@ def promote_type(t: TIFFType) -> TIFFType:
     return t
     return t
 
 
 
 
-def tiff_type_to_cpp(t: TIFFType, without_promotion: bool = False) -> str:
+def tiff_type_to_cpp(t: TIFFType, with_promotion: bool = True) -> str:
     # To simplify the code generator and the Metadata class API, all u16 are promoted to u32
     # To simplify the code generator and the Metadata class API, all u16 are promoted to u32
     # Note that the Value<> type doesn't include u16 for this reason
     # Note that the Value<> type doesn't include u16 for this reason
-    if not without_promotion:
+    if with_promotion:
         t = promote_type(t)
         t = promote_type(t)
     if t in [TIFFType.ASCII, TIFFType.UTF8]:
     if t in [TIFFType.ASCII, TIFFType.UTF8]:
         return 'String'
         return 'String'
@@ -232,7 +232,7 @@ struct TypePromoter<{}> {{
 """
 """
     for t in TIFFType:
     for t in TIFFType:
         if promote_type(t) != t:
         if promote_type(t) != t:
-            output += specialization_template.format(tiff_type_to_cpp(t, without_promotion=True), tiff_type_to_cpp(t))
+            output += specialization_template.format(tiff_type_to_cpp(t, with_promotion=False), tiff_type_to_cpp(t))
 
 
     return output
     return output