diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2009-10-16 20:06:47 +0000 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2009-10-16 20:06:47 +0000 |
commit | a20ba78b5e14a62e3bc4f1f879e900fb1ecd0f79 (patch) | |
tree | 34ad84014dab6e53e04279b4c1593d172245a476 /FunctionBar.c | |
parent | 1e124da059cb21cb85e824e4f35ba222c96e29bd (diff) |
simplify code
Diffstat (limited to 'FunctionBar.c')
-rw-r--r-- | FunctionBar.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/FunctionBar.c b/FunctionBar.c index a66d74c0..70339ca9 100644 --- a/FunctionBar.c +++ b/FunctionBar.c @@ -52,14 +52,12 @@ FunctionBar* FunctionBar_new(char** functions, char** keys, int* events) { this->functions = malloc(sizeof(char*) * 15); this->keys = malloc(sizeof(char*) * 15); this->events = malloc(sizeof(int) * 15); - int i = 0; - while (i < 15 && functions[i]) { + for (int i = 0; i < 15 && functions[i]; i++) { this->functions[i] = String_copy(functions[i]); this->keys[i] = String_copy(keys[i]); this->events[i] = events[i]; - i++; + this->size = i; } - this->size = i; } else { this->staticData = true; this->functions = functions ? functions : FunctionBar_FLabels; |