Bug 1541095: Remove an unnecessary static_cast in WritingModes.h. r=TYLin

The variables involved in the bitwise arithmetic are all of type uint8_t, so
we end up with that type automatically (no need to bother with a static_cast).

Note that we *do* need to declare the type (we can't use `auto`, or else
the compiler wants to upgrade the local variable to have a wider type --
"int", I think -- and that then produces an build warning when we pass
that variable as a uint8_t param further down).

Differential Revision: https://phabricator.services.mozilla.com/D61893

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Daniel Holbert 2020-02-07 00:39:28 +00:00
Родитель 77ad2585dd
Коммит a4b224a290
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -447,9 +447,9 @@ class WritingMode {
MOZ_ASSERT(StyleWritingMode::VERTICAL.bits == 0x01 &&
StyleWritingMode::VERTICAL_LR.bits == 0x04,
"unexpected mask values");
const auto wm = static_cast<uint8_t>(
const uint8_t wm =
((mWritingMode & StyleWritingMode::VERTICAL_LR).bits >> 1) |
(mWritingMode & StyleWritingMode::VERTICAL).bits);
(mWritingMode & StyleWritingMode::VERTICAL).bits;
return PhysicalSideForBlockAxis(wm, GetEdge(aSide));
}