• deltapi@lemmy.world
      link
      fedilink
      English
      arrow-up
      54
      arrow-down
      1
      ·
      1 day ago

      No, you can’t have a group of zero, so the counter doesn’t need to waste a position counting zero.

      • HereIAm@lemmy.world
        link
        fedilink
        English
        arrow-up
        11
        ·
        1 day ago

        If you ever create a system where the number of users is “group.members - 1” everywhere in the code, I’d be very disappointed in you and deny that PR.

        On another note; I doubt WhatsApp are so concerned with performance they are actually limiting the number of group members by the data type.

        • BillBurBaggins@lemmy.world
          link
          fedilink
          English
          arrow-up
          9
          ·
          1 day ago

          But it wouldn’t be like that though would it. It would be public group.members() and the u8 would be private.

          If all the millions of groups are saved on a central database then making the size a u8 isn’t really that weird

          • HereIAm@lemmy.world
            link
            fedilink
            English
            arrow-up
            3
            ·
            23 hours ago

            I hadn’t thought about it on their server side tbf. But the more i think about it maybe there are other compounding reasons to keep group sizes small, such as the exponential number of links in a growing network and such. But, that is all beyond my knowledge area.

      • seejur@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        20 hours ago

        You cannot also have a group of 1, therefore either is 255 or 257. 256 is oddly specific (or the code was made by an intern)