mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
util: xml: clean up unnecessary ret variables
Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
441d2f4e23
commit
69e810945e
@ -74,7 +74,6 @@ virXPathString(const char *xpath,
|
|||||||
xmlXPathContextPtr ctxt)
|
xmlXPathContextPtr ctxt)
|
||||||
{
|
{
|
||||||
g_autoptr(xmlXPathObject) obj = NULL;
|
g_autoptr(xmlXPathObject) obj = NULL;
|
||||||
char *ret;
|
|
||||||
|
|
||||||
if ((ctxt == NULL) || (xpath == NULL)) {
|
if ((ctxt == NULL) || (xpath == NULL)) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
@ -86,8 +85,7 @@ virXPathString(const char *xpath,
|
|||||||
(obj->stringval == NULL) || (obj->stringval[0] == 0)) {
|
(obj->stringval == NULL) || (obj->stringval[0] == 0)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ret = g_strdup((char *)obj->stringval);
|
return g_strdup((char *)obj->stringval);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -888,7 +886,6 @@ virXPathBoolean(const char *xpath,
|
|||||||
xmlXPathContextPtr ctxt)
|
xmlXPathContextPtr ctxt)
|
||||||
{
|
{
|
||||||
g_autoptr(xmlXPathObject) obj = NULL;
|
g_autoptr(xmlXPathObject) obj = NULL;
|
||||||
int ret;
|
|
||||||
|
|
||||||
if ((ctxt == NULL) || (xpath == NULL)) {
|
if ((ctxt == NULL) || (xpath == NULL)) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
@ -900,9 +897,7 @@ virXPathBoolean(const char *xpath,
|
|||||||
(obj->boolval < 0) || (obj->boolval > 1)) {
|
(obj->boolval < 0) || (obj->boolval > 1)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ret = obj->boolval;
|
return obj->boolval;
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -920,7 +915,6 @@ virXPathNode(const char *xpath,
|
|||||||
xmlXPathContextPtr ctxt)
|
xmlXPathContextPtr ctxt)
|
||||||
{
|
{
|
||||||
g_autoptr(xmlXPathObject) obj = NULL;
|
g_autoptr(xmlXPathObject) obj = NULL;
|
||||||
xmlNodePtr ret;
|
|
||||||
|
|
||||||
if ((ctxt == NULL) || (xpath == NULL)) {
|
if ((ctxt == NULL) || (xpath == NULL)) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
@ -934,8 +928,7 @@ virXPathNode(const char *xpath,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = obj->nodesetval->nodeTab[0];
|
return obj->nodesetval->nodeTab[0];
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user