Why are the methods - and - outdated for the list?

The operators / methods -- and - in the list are out of date.

For -- we get: "Deprecated: use list1 filterNot (list2 contains) instead"

The proposed use is detailed. Why refuse operators?

+4
source share
1 answer

I found that -- really is a difference operator, which logically refers to Set , not List . For this reason -- does not become obsolete on Set .

For List filter operation makes more sense. So it could just be a logical sequence.

+5
source

Source: https://habr.com/ru/post/1344233/


All Articles