0
点赞
收藏
分享

微信扫一扫

.NET 6 在已知拓扑路径的情况下使用 Dijkstra,A*算法搜索最短路径

凶猛的小白兔 2023-11-21 阅读 31

根据列表中的某个字段进行去重

// 根据roleKey对列表去重
            return roleList.stream()
                    .map(AccountRole::getRoleKey)
                    .distinct()
                    .map(roleKey -> roleList.stream()
                            .filter(role -> role.getRoleKey().equals(roleKey))
                            .findFirst()
                            .orElse(null))
                    .filter(Objects::nonNull)
                    .collect(Collectors.toList());
举报

相关推荐

0 条评论