Commit 63f16713 authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

Use || instead of | for logical expressions

In its last action before being turned off the VC++ compiler said:
    warning.cpp(2): warning C4554: '|': check operator precedence for
    possible error; use parentheses to clarify precedence

The code is not wrong, but it is confusing. By default we should use
logical operators for logical expressions, and bitwise operators for
bitwise expressions.

See also this request for a similar warning in clang:
    https://bugs.llvm.org/show_bug.cgi?id=37155

Bug: 825568
Change-Id: I339744f004258137d72b23bfe047901dd40be4ad
Reviewed-on: https://chromium-review.googlesource.com/1015780Reviewed-by: default avatarTimothy Loh <timloh@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551550}
parent afb472c0
...@@ -1007,7 +1007,7 @@ String StylePropertySerializer::BorderImagePropertyValue() const { ...@@ -1007,7 +1007,7 @@ String StylePropertySerializer::BorderImagePropertyValue() const {
continue; continue;
if (!result.IsEmpty()) if (!result.IsEmpty())
result.Append(" "); result.Append(" ");
if (i == 2 | i == 3) if (i == 2 || i == 3)
result.Append("/ "); result.Append("/ ");
result.Append(value_text); result.Append(value_text);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment