summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 10d8f66)
raw | patch | inline | side by side (parent: 10d8f66)
author | Max Kellermann <max@duempel.org> | |
Mon, 2 Nov 2009 21:51:05 +0000 (22:51 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Mon, 2 Nov 2009 21:51:05 +0000 (22:51 +0100) |
Faster than a manual "for" loop.
src/screen_song.c | patch | blob | history |
diff --git a/src/screen_song.c b/src/screen_song.c
index 750beeba2c00e55cde552c2aad3043737a0cab49..5f652f527a5120513f4fc7bf98905fc08fb3cd4f 100644 (file)
--- a/src/screen_song.c
+++ b/src/screen_song.c
if (i == 0) {
entry_iter = entry + g_sprintf(entry, "%s: ", label);
/* fill the label column with whitespaces */
- for ( ; entry_iter < entry + label_size; ++entry_iter)
- *entry_iter = ' ';
+ memset(entry_iter, ' ',
+ entry + label_size - entry_iter);
+ entry_iter = entry + label_size;
}
else {
- entry_iter = entry;
/* fill the label column with whitespaces */
- for ( ; entry_iter < entry + label_col; ++entry_iter)
- *entry_iter = ' ';
+ memset(entry, ' ', label_col);
+ entry_iter = entry + label_col;
}
/* skip whitespaces */
while (g_ascii_isspace(*value_iter)) ++value_iter;