Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 241551c

Browse files
committed
do_env_cfuncdesc(): Push as much of the generated HTML into one place
as possible for better readability. Revise a comment.
1 parent a8e484c commit 241551c

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Doc/perl/python.perl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -644,23 +644,23 @@ sub do_env_cfuncdesc{
644644
my $idx = make_str_index_entry(
645645
"<tt class='cfunction'>$function_name()</tt>" . get_indexsubitem());
646646
$idx =~ s/ \(.*\)//;
647-
$idx =~ s/\(\)//; # ????
647+
$idx =~ s/\(\)//; # ???? - why both of these?
648648
my $result_rc = get_refcount($function_name, '');
649649
my $rcinfo = '';
650650
if ($result_rc eq '+1') {
651-
$rcinfo = '<span class="label">Return value:</span>'
652-
. "\n <span class=\"value\">New reference.</span>";
651+
$rcinfo = 'New reference';
653652
}
654653
elsif ($result_rc eq '0') {
655-
$rcinfo = '<span class="label">Return value:</span>'
656-
. "\n <span class=\"value\">Borrowed reference.</span>";
654+
$rcinfo = 'Borrowed reference';
657655
}
658656
elsif ($result_rc eq 'null') {
659-
$rcinfo = '<span class="label">Return value:</span>'
660-
. "\n <span class=\"value\">Always NULL.</span>";
657+
$rcinfo = 'Always <tt class="constant">NULL</tt>';
661658
}
662659
if ($rcinfo ne '') {
663-
$rcinfo = "\n<div class=\"refcount-info\">\n $rcinfo\n</div>";
660+
$rcinfo = ( "\n<div class=\"refcount-info\">"
661+
. "\n <span class=\"label\">Return value:</span>"
662+
. "\n <span class=\"value\">$rcinfo.</span>"
663+
. "\n</div>");
664664
}
665665
return "<dl><dt>$return_type <b>$idx</b> (<var>$arg_list</var>)\n<dd>"
666666
. $rcinfo

0 commit comments

Comments
 (0)