getdata: skip strings before nth_field analysis

This will allow nth_field function to begin from first field, and stop
immediately when it ends, which makes function much more simple and quite
a bit quicker.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2012-11-09 23:29:49 +00:00
parent b918e9157d
commit 4341d92d41
2 changed files with 12 additions and 30 deletions

View file

@ -157,8 +157,8 @@ int prepare_memory(void);
int parse_leases(void);
void parse_config(int, const char *__restrict, struct shared_network_t *__restrict)
__attribute__ ((nonnull(2, 3)));
int nth_field(int n, char *__restrict dest, const char *__restrict src)
__attribute__ ((nonnull(2, 3)))
void nth_field(char *__restrict dest, const char *__restrict src)
__attribute__ ((nonnull(1, 2)))
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
__attribute__ ((__hot__))
#endif