Ad
  • Default User Avatar

    Where do you see a loop here? Cuz I don't. You probably mean indexing the array but thaht does not cause an enumeration of the array. indexing an Array is pretty much the fastest thing you can do, even faster than accessing a HashMap aka Dictionary by Key or most other data structures.

  • Default User Avatar

    it is not efficient as it has to loop each and every single item. A switch statement is very efficient, it does not loop through items one by one. It uses dictionary algorithms behind the scene.
    And this hard to read as well.
    Strive for simplicity.

  • Custom User Avatar

    ....this hurts my eyes

  • Custom User Avatar

    Very efficient but not easy to read