ahmcsxcc
V2EX  ›  问与答

golang 的 slice 没有 contains, indexOf 这两个函数吗?

  •  
  •   ahmcsxcc · Jul 23, 2019 · 3266 views
    This topic created in 2510 days ago, the information mentioned may be changed or developed.
    4 replies    2019-07-24 10:03:33 +08:00
    SuperMild
        1
    SuperMild  
       Jul 23, 2019
    slice 本身没有任何函数或方法。
    ahmcsxcc
        2
    ahmcsxcc  
    OP
       Jul 23, 2019
    @SuperMild #1
    类似 strings 这种
    wspsxing
        3
    wspsxing  
       Jul 23, 2019 via Android
    大道至简,请自己实现
    ahmcsxcc
        4
    ahmcsxcc  
    OP
       Jul 24, 2019
    @wspsxing #3
    我代码写的很烂
    自己实现的性能很差
    说不定就内存泄漏了
    时间,空间复杂度肯定没有官方写的好
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3026 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 14:26 · PVG 22:26 · LAX 07:26 · JFK 10:26
    ♥ Do have faith in what you're doing.