Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/perl5Public

Commitd2bdba3

Browse files
committed
S_uiv_2buf: code quality improvements suggested in GH#22927
1 parent0e374ed commitd2bdba3

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

‎sv_inline.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,7 +1044,6 @@ S_uiv_2buf(char *const buf, const IV iv, UV uv, const int is_uv, char **const pe
10441044
{
10451045
char*ptr=buf+TYPE_CHARS(UV);
10461046
char*constebuf=ptr;
1047-
intsign;
10481047
U16*word_ptr,*word_table;
10491048

10501049
PERL_ARGS_ASSERT_UIV_2BUF;
@@ -1055,15 +1054,17 @@ S_uiv_2buf(char *const buf, const IV iv, UV uv, const int is_uv, char **const pe
10551054
word_ptr= (U16*)ptr;
10561055
word_table= (U16*)Perl_int2str_table.arr;
10571056

1058-
if (UNLIKELY(is_uv))
1059-
sign=0;
1060-
elseif (iv >=0) {
1061-
uv=iv;
1062-
sign=0;
1063-
}else {
1064-
/* Using 0- here to silence bogus warning from MS VC */
1065-
uv= (UV) (0- (UV)iv);
1066-
sign=1;
1057+
boolsign= false;
1058+
if (LIKELY(!is_uv)) {
1059+
if (iv >=0) {
1060+
uv=iv;
1061+
}else {
1062+
/* This is NEGATE_2UV(iv), which can be found in handy.h. */
1063+
/* sv_inline.h does not include handy.h because the latter
1064+
* would then get included twice into .c files. */
1065+
uv= (ASSUME((iv)<0), (UV)-((iv)+1)+1U);
1066+
sign=1;
1067+
}
10671068
}
10681069

10691070
while (uv>99) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp