Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Set-内部编码

  • 集合

    • 最多存储232 - 1个元素,约42.9亿
    • 不允许有重复的元素
  • 使用场景

  • 源代码文件:t_set.c

  • 可选编码类型

    • intset —— OBJ_ENCODING_INTSET
      • 整数集合,少于512个元素、且元素均为整数时采用
      • 512 是 set-max-inset-entries 的默认值
    • hashtable —— OBJ_ENCODING_HT
      • 哈希表
  • 对应底层实现文件:分别在intset.cdict.c