Comment on I wish

<- View Parent
robotica@lemmy.world ⁨1⁩ ⁨year⁩ ago

Don’t forget that you can have fall-through cases, so you can simplify it even further:

switch (number) {
    case 1:
    case 2:
    case 3:
    case 4:
    case 5:
      ...

source
Sort:hotnewtop