我也分享一段前辈的代码,哈哈

327 天前
 haitaoli
List<HighxjRollVo> collect9 = highxjRollVoList.stream().filter(x -> x.getGradets().length() == 1 && gradelist.contains(x.getGradets())).filter(x -> !((Calendar.getInstance().get(Calendar.MONTH) + 1)-8 >0 ? ("20"+String.valueOf(Integer.valueOf(x.getHighStudentId().substring(0, 2))+Integer.valueOf(x.getGradets())-10)).equals(yearLast) : ("20"+String.valueOf(Integer.valueOf(x.getHighStudentId().substring(0, 2))+Integer.valueOf(x.getGradets())-10)).equals(beforeYearLast))).collect(Collectors.toList());

前辈写的,而且没有换行,全在一行里面
给我看的头疼,我都是让 gpt 帮我解释一下这行代码干了啥🤣

2367 次点击
所在节点    程序员
9 条回复
OutOfMemoryError
327 天前
idea 一键格式化不就好了么 这个项目的
hhjswf
327 天前
咋一看像前端混淆的代码
PungentSauce
327 天前
就俩过滤
chenPiMeiHaoChi
327 天前
道理我都懂,但为什么是 collect9 ?想想还有 12345678 就更吓人了。
assiadamo
327 天前
```
List<String> list = new ArryList<>();
for (int i = 0; i < strs.length; i++) {
if (list.contains(strs[i]))
continue;
list.add(strs[i]);
}
```
刚刚看到的代码
haitaoli
327 天前
@chenPiMeiHaoChi 哈哈 看的好细 总共 collect29🤣
yazinnnn
327 天前


贴个刚写的烂代码
jasonjames
327 天前
大佬 囚牢囚牢
@haitaoli
Jarred711
323 天前
In summary, the code filters a list of HighxjRollVo objects based on specific conditions using Java 8 Stream API. The resulting filtered elements are collected into a new list assigned to the collect9 variable.

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/949361

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX