V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
Nilus
V2EX  ›  程序员

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

  •  
  •   Nilus · Jun 16, 2023 · 3286 views
    This topic created in 1046 days ago, the information mentioned may be changed or developed.
    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 帮我解释一下这行代码干了啥🤣

    9 replies    2023-06-21 11:02:58 +08:00
    OutOfMemoryError
        1
    OutOfMemoryError  
       Jun 16, 2023
    idea 一键格式化不就好了么 这个项目的
    hhjswf
        2
    hhjswf  
       Jun 16, 2023 via Android
    咋一看像前端混淆的代码
    PungentSauce
        3
    PungentSauce  
       Jun 16, 2023
    就俩过滤
    chenPiMeiHaoChi
        4
    chenPiMeiHaoChi  
       Jun 16, 2023
    道理我都懂,但为什么是 collect9 ?想想还有 12345678 就更吓人了。
    badbye
        5
    badbye  
       Jun 16, 2023
    ```
    List<String> list = new ArryList<>();
    for (int i = 0; i < strs.length; i++) {
    if (list.contains(strs[i]))
    continue;
    list.add(strs[i]);
    }
    ```
    刚刚看到的代码
    Nilus
        6
    Nilus  
    OP
       Jun 16, 2023
    @chenPiMeiHaoChi 哈哈 看的好细 总共 collect29🤣
    yazinnnn
        7
    yazinnnn  
       Jun 16, 2023


    贴个刚写的烂代码
    jasonjames
        8
    jasonjames  
       Jun 16, 2023
    大佬 囚牢囚牢
    @haitaoli
    Jarred711
        9
    Jarred711  
       Jun 21, 2023
    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.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   994 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 70ms · UTC 20:12 · PVG 04:12 · LAX 13:12 · JFK 16:12
    ♥ Do have faith in what you're doing.