summaryrefslogtreecommitdiff
path: root/src/install.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-08-01 00:43:05 +0200
committerLennart Poettering <lennart@poettering.net>2011-08-01 00:43:05 +0200
commitf975e971accc4d50c73ae53167db3df7a7099cf2 (patch)
treeba7442194a0e6a13cb12645db19e90073f2cb80b /src/install.c
parentf786e80d7a76fd7446d142f610d62ea8c28ed902 (diff)
load-fragment: speed up parsing by using a perfect hash table with configuration settings built by gperf
Diffstat (limited to 'src/install.c')
-rw-r--r--src/install.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/install.c b/src/install.c
index b843ee156b..7443973502 100644
--- a/src/install.c
+++ b/src/install.c
@@ -1019,11 +1019,11 @@ static int unit_file_load(
const char *path,
bool allow_symlink) {
- const ConfigItem items[] = {
- { "Alias", config_parse_strv, 0, &info->aliases, "Install" },
- { "WantedBy", config_parse_strv, 0, &info->wanted_by, "Install" },
- { "Also", config_parse_also, 0, c, "Install" },
- { NULL, NULL, 0, NULL, NULL }
+ const ConfigTableItem items[] = {
+ { "Install", "Alias", config_parse_strv, 0, &info->aliases },
+ { "Install", "WantedBy", config_parse_strv, 0, &info->wanted_by },
+ { "Install", "Also", config_parse_also, 0, c },
+ { NULL, NULL, NULL, 0, NULL }
};
int fd;
@@ -1044,7 +1044,7 @@ static int unit_file_load(
return -ENOMEM;
}
- r = config_parse(path, f, NULL, items, true, info);
+ r = config_parse(path, f, NULL, config_item_table_lookup, (void*) items, true, info);
fclose(f);
if (r < 0)
return r;