I have a piece of software which has different users (admin/user) In the admin version you are able to upload the changes straight away. Whereas a user doesn't have this ability have to save it to get authorisation. To display the options I wrote my code like this.
actionMode = ActionBarMode.SaveCancel;
if (Config.ConfigVersion < 1)
{
//Allow the user to upload logs to trackserver
this.ActionMode = ActionBarMode.SaveUploadCancel;
}
actionMode is declared elsewhere and I am just changing it in this event handler. I was wondering what the cost implications of assigning the variable twice in the case of an admin user vs using an if else statement.
I know this cost (if any) is likely to be negligible, but I was just curious.
Edit to explain why its not a duplicate of that question: While yes my question is about Micro-Optimising, my question is more about a specific case which I was just curious about. I do acknowledge that at the end of my post but I do really appreciate the link because it is a great read.