فهرست منبع

Add note on sparse vs contiguous

FourteenBrush 2 ماه پیش
والد
کامیت
cb05271157
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      base/intrinsics/intrinsics.odin

+ 2 - 1
base/intrinsics/intrinsics.odin

@@ -213,7 +213,8 @@ type_is_subtype_of :: proc($T, $U: typeid) -> bool ---
 
 type_field_index_of :: proc($T: typeid, $name: string) -> uintptr ---
 
-// Contiguous as in having a set of constants, when sorted, the difference between consecutive constants is only 0 or 1
+// "Contiguous" means that the set of enum constants, when sorted, have a difference of either 0 or 1 between consecutive values.
+// This is the exact opposite of "sparse".
 type_enum_is_contiguous :: proc($T: typeid) -> bool where type_is_enum(T) ---
 
 type_equal_proc  :: proc($T: typeid) -> (equal:  proc "contextless" (rawptr, rawptr) -> bool)                 where type_is_comparable(T) ---