去掉一个list中包含的另一个list数据,高效写法

            LinkedList veirfyingList = questionService.getVeirfying(cityCode);
            LinkedList verifiedList = questionService.getVerifiedQuestion(uid, cityCode);
            HashSet h1 = new HashSet(veirfyingList);
            HashSet h2 = new HashSet(verifiedList);
            h1.removeAll(h2);
            veirfyingList.clear();
            veirfyingList.addAll(h1);

 

你可能感兴趣的:(Java)