From 342cb665371e74b5ab6bc133c02da6554eacff73 Mon Sep 17 00:00:00 2001 From: shikai-123 Date: Fri, 25 Feb 2022 09:29:18 +0800 Subject: [PATCH] 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 --- util/js_textdecoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/js_textdecoder.cpp b/util/js_textdecoder.cpp index 55bafc1..a5dc293 100755 --- a/util/js_textdecoder.cpp +++ b/util/js_textdecoder.cpp @@ -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(ConverterFlags::FLUSH_FLG); + flags |= (iflag ? 0 : static_cast(ConverterFlags::FLUSH_FLG)); UBool flush = ((flags & static_cast(ConverterFlags::FLUSH_FLG))) == static_cast(ConverterFlags::FLUSH_FLG); napi_typedarray_type type; -- Gitee