summaryrefslogtreecommitdiffstats
path: root/__root__
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2015-04-03 19:01:27 +0200
committerJan Pokorný <jpokorny@redhat.com>2015-04-08 19:56:06 +0200
commite16192064144e8c21a5889e7ae3249848375c048 (patch)
tree81a5b59328c51ddf2ddfd62ca6fed38a72c2d769 /__root__
parente8d88166b0091223c783a4cab9fa5919b9a0c0c7 (diff)
downloadclufter-e16192064144e8c21a5889e7ae3249848375c048.tar.gz
clufter-e16192064144e8c21a5889e7ae3249848375c048.tar.xz
clufter-e16192064144e8c21a5889e7ae3249848375c048.zip
ccs-flatten/restree: use shorter, memoized expression
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to '__root__')
-rw-r--r--__root__/ccs-flatten/restree.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/__root__/ccs-flatten/restree.c b/__root__/ccs-flatten/restree.c
index 4a45679..7bfefa8 100644
--- a/__root__/ccs-flatten/restree.c
+++ b/__root__/ccs-flatten/restree.c
@@ -64,23 +64,23 @@ res_do_flatten(xmlNode ** xpp, xmlNode * rmp, resource_node_t * node, const char
char buf[256];
int x, y;
- n = xmlNewNode(NULL, (xmlChar *) node->rn_resource->r_rule->rr_type);
+ n = xmlNewNode(NULL, (xmlChar *) res->r_rule->rr_type);
xmlSetProp(n, (xmlChar *) "rgmanager-meta-agent",
- (xmlChar *) basename(node->rn_resource->r_rule->rr_agent));
+ (xmlChar *) basename(res->r_rule->rr_agent));
/* Multiple-instance resources must be decomposed into separate
resources */
- if (node->rn_resource->r_refs > 1) {
+ if (res->r_refs > 1) {
snprintf(buf, sizeof(buf), "%s_%d",
- primary_attr_value(node->rn_resource), node->rn_resource->r_incarnations);
- ++node->rn_resource->r_incarnations;
+ primary_attr_value(res), res->r_incarnations);
+ ++res->r_incarnations;
} else {
- snprintf(buf, sizeof(buf), "%s", primary_attr_value(node->rn_resource));
+ snprintf(buf, sizeof(buf), "%s", primary_attr_value(res));
}
- for (x = 0; node->rn_resource->r_attrs && node->rn_resource->r_attrs[x].ra_name; x++) {
- ra = &node->rn_resource->r_attrs[x];
+ for (x = 0; res->r_attrs && res->r_attrs[x].ra_name; x++) {
+ ra = &res->r_attrs[x];
if (ra->ra_flags & RA_PRIMARY) {
xmlSetProp(n, (xmlChar *) ra->ra_name, (xmlChar *) buf);
@@ -107,8 +107,8 @@ res_do_flatten(xmlNode ** xpp, xmlNode * rmp, resource_node_t * node, const char
if (!rmp) {
xmlAddChild(*xpp, n);
} else {
- r = xmlNewNode(NULL, (xmlChar *) node->rn_resource->r_rule->rr_type);
- xmlSetProp(r, (xmlChar *) "ref", (xmlChar *) primary_attr_value(node->rn_resource));
+ r = xmlNewNode(NULL, (xmlChar *) res->r_rule->rr_type);
+ xmlSetProp(r, (xmlChar *) "ref", (xmlChar *) primary_attr_value(res));
xmlAddChild(rmp, n);
xmlAddChild(*xpp, r);
}