Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tihirvon committed Nov 11, 2012
1 parent 42ae207 commit 15905fa
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions options.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,19 +562,19 @@ void toggle_option_values(const char *name, bool global, bool verbose, char **va
{
const struct option_description *desc = find_toggle_option(name, &global);
int i, count = count_strings(values);
char *ptr = NULL;
char *ptr;

if (!desc)
return;

if (global) {
ptr = global_ptr(desc);
} else {
ptr = local_ptr(desc, &buffer->options);
}
if (desc->type == OPT_STR) {
char *value;

if (global)
ptr = global_ptr(desc);
else
ptr = local_ptr(desc, &buffer->options);

value = *(char **)ptr;
for (i = 0; i < count; i++) {
if (streq(values[i], value))
Expand Down Expand Up @@ -621,11 +621,6 @@ void toggle_option_values(const char *name, bool global, bool verbose, char **va
break;
}

if (global)
ptr = global_ptr(desc);
else
ptr = local_ptr(desc, &buffer->options);

value = *(int *)ptr;
for (i = 0; i < count; i++) {
if (value == ints[i])
Expand Down

0 comments on commit 15905fa

Please sign in to comment.