Why does ColoredSet function has CID set for pinned data when doing GC?

Hello. I have a question.

Why does ColoredSet function has CID-set for pinned data when doing GC? instead of unppined data? (I’m asking at the code level (go-ipfs/gc.go))

I think IPFS can create a CID-set for unpinned data and then delete the block included in the CID, is that correct?

Thank you.

Because you don’t know what is unpinned.
This is a normal tricoloring traversal implementation, you can read about Go’s one here https://pusher.github.io/tricolor-gc-visualization/ (it’s not the one used here but the algorithm is the same).

Thank you so much for the quick reply
I will read the link you gave!