From 0693cfb11641e4c443e9eb882edda7e6f6d58fbd Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 24 Dec 2013 01:16:51 +0100 Subject: [PATCH] Simplify print_def structure --- xs/xsp/Config.xsp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xs/xsp/Config.xsp b/xs/xsp/Config.xsp index 7373dbee9..3f053061d 100644 --- a/xs/xsp/Config.xsp +++ b/xs/xsp/Config.xsp @@ -99,7 +99,7 @@ print_config_def() (void)hv_stores( hv, "max", newSViv(optdef->max) ); // aliases - { + if (!optdef->aliases.empty()) { AV* av = newAV(); av_fill(av, optdef->aliases.size()-1); for (std::vector::iterator it = optdef->aliases.begin(); it != optdef->aliases.end(); ++it) @@ -108,7 +108,7 @@ print_config_def() } // shortcut - { + if (!optdef->shortcut.empty()) { AV* av = newAV(); av_fill(av, optdef->shortcut.size()-1); for (std::vector::iterator it = optdef->shortcut.begin(); it != optdef->shortcut.end(); ++it) @@ -117,7 +117,7 @@ print_config_def() } // enum_values - { + if (!optdef->enum_values.empty()) { AV* av = newAV(); av_fill(av, optdef->enum_values.size()-1); for (std::vector::iterator it = optdef->enum_values.begin(); it != optdef->enum_values.end(); ++it) @@ -126,7 +126,7 @@ print_config_def() } // enum_labels - { + if (!optdef->enum_labels.empty()) { AV* av = newAV(); av_fill(av, optdef->enum_labels.size()-1); for (std::vector::iterator it = optdef->enum_labels.begin(); it != optdef->enum_labels.end(); ++it)