Skip to content

Commit b83d675

Browse files
Andy Firthfacebook-github-bot
Andy Firth
authored andcommitted
- fix for string conversion losing precision
Summary: TSIL diff is part of re-enabling -Wconversion for HSR. ``` buck-out/v2/gen/fbcode/07838712e61ba1ef/folly/__string__/buck-headers/folly/String-inl.h:222:33: error: implicit conversion loses integer precision: 'int' to 'char' [-Werror,-Wimplicit-int-conversion] 222 | out.push_back((h1 << 4) | h2); ``` resolved by casting the type of h1. Reviewed By: mshamis85 Differential Revision: D71142996 fbshipit-source-id: 4b3a873a72784b2fb556d62a33c5b307bf666007
1 parent 7e0a8f0 commit b83d675

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

third-party/folly/src/folly/String-inl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ bool tryUriUnescape(StringPiece str, String& out, UriEscapeMode mode) {
219219
return false;
220220
}
221221
out.append(&*last, size_t(p - last));
222-
out.push_back((h1 << 4) | h2);
222+
out.push_back(decltype(h1)(h1 << 4) | h2);
223223
p += 3;
224224
last = p;
225225
break;

0 commit comments

Comments
 (0)