I'm not sure what your suggestion is.  I don't see how 
    
    if(os != "win") {
      switch(...)
    } else {
      switch(...)
    }

would be faster then its current incarnation even if you added a return block.