Discord.SortedSet.index_add

You're seeing just the function index_add, go back to Discord.SortedSet module for more information.

Specs

index_add(set :: t(), item :: any()) ::
  {index :: non_neg_integer() | nil, t()}
  | Discord.SortedSet.Types.common_errors()

Adds an item to the set, returning the index.

If the index is not needed the add/2 function can be used instead, there is no performance difference between these two functions.

Performance

Unlike a hash based set that has O(1) inserts, the SortedSet is O(log(N/B)) + O(log(B)) where N is the number of items in the SortedSet and B is the Bucket Size.