Spare a few more lines rather than having a condition with a nested
ternary.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
{
if (!buf || buf->error)
return;
- if (indent > 0 ? INT_MAX - indent < buf->indent
- : buf->indent < -indent) {
- virBufferSetError(buf, -1);
- return;
+
+ if (indent > 0) {
+ if (INT_MAX - indent < buf->indent) {
+ virBufferSetError(buf, -1);
+ return;
+ }
+ } else {
+ if (buf->indent < -indent) {
+ virBufferSetError(buf, -1);
+ return;
+ }
}
+
buf->indent += indent;
}