StringPool_Tips.lua 247 B

12345678910111213
  1. ---@class StringPool
  2. StringPool = {}
  3. ---@class str2id
  4. local str2id = {}
  5. function StringPool.ToID(str)
  6. local id = str2id[str]
  7. if not id then
  8. id = CS.TCFramework.StringPool.Add(str)
  9. str2id[str] = id
  10. end
  11. return id
  12. end