Modify defects of util

Deal with a priority problem of ternary operation

https://gitee.com/openharmony/js_util_module/issues/I4V6Y1

Signed-off-by: shikai-123 <shikai25@huawei.com>
This commit is contained in:
shikai-123
2022-02-25 09:29:18 +08:00
parent f7ba136856
commit c7ba8f21a9
+1 -1
View File
@@ -62,7 +62,7 @@ namespace OHOS::Util {
napi_value TextDecoder::Decode(napi_value src, bool iflag)
{
uint32_t flags = 0;
flags |= iflag ? 0 : static_cast<uint32_t>(ConverterFlags::FLUSH_FLG);
flags |= (iflag ? 0 : static_cast<uint32_t>(ConverterFlags::FLUSH_FLG));
UBool flush = ((flags & static_cast<uint32_t>(ConverterFlags::FLUSH_FLG))) ==
static_cast<uint32_t>(ConverterFlags::FLUSH_FLG);
napi_typedarray_type type;