What's the fastest way to evaluate a long chain of if-then-else?

Say I have code like this:

if (var == OPTION_A) {
  // Statements
}
else if (var == OPTION_B) {
  // Statements
}
else if (var == OPTION_C) {
  // Statements
}
else if (var == OPTION_D) {
  // Statements
}
else if (var == OPTION_E) {
  // Statements
}
else if (var == OPTION_F) {
  // Statements
}
else if (var == OPTION_G) {
  // Statements
}
else {
  // Statements
}

Is this the best way to write such as expression? I only worry because my list is growing rather long (currently twelve such branches). In each case, the entire warp will dive into one branch, but every OPTION_ I’ve got is an integer code, so I wonder if it’s not better to write

if (var < OPTION_E) {
  if (var == OPTION_A) {
    // Statements
  }
  else if (var == OPTION_B) {
    // Statements
  }
  else if (var == OPTION_C) {
    // Statements
  }
  else if (var == OPTION_D) {
    // Statements
  }
}
else {
  if (var == OPTION_E) {
    // Statements
  }
  else if (var == OPTION_F) {
    // Statements
  }
  else if (var == OPTION_G) {
    // Statements
  }
  else {
    // Statements
  }
}

And perhaps bifurcate even more. My code won’t look any more difficult to read for such nesting; I’ve got it set up pretty well. The code within each branch is a lot more meaty than a handful of if-thens, so the case switch to get us into the section that is needed is still a relatively minor expense, but I want to know if that cost is growing with each new option I add, and if so what I can do about it.

Thanks!

With this minimum of information, I’d say this looks like a case for templates, which will allow you to get rid of if-statements executed at runtime, and will likely enable additional optimizations because of that. Even if this results in dozens of template instances, I would still recommend it.