fn get_or_insert<T: IDLike>(id: T, set: &mut IndexSet<T>) -> T
Get the specified ID from set or insert if it doesn’t exist.
set
The purpose of returning an ID is so that we can dedup memory.