Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_layout_inline_items_builder.cc

Issue 2770203002: Replace DCHECK with DCHECK_op and split some DCHECKs wherever necessary (Closed)
Patch Set: Add few more Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/ng_layout_inline_items_builder.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_inline_items_builder.cc b/third_party/WebKit/Source/core/layout/ng/ng_layout_inline_items_builder.cc
index cd83ca1e370aee21197006c0938519d3302212a3..099daab7000e2b46943b79b6165943ac4156d3a6 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_layout_inline_items_builder.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_inline_items_builder.cc
@@ -55,7 +55,8 @@ static bool ShouldRemoveNewlineSlow(const StringBuilder& before,
const ComputedStyle* after_style) {
// Remove if either before/after the newline is zeroWidthSpaceCharacter.
UChar32 last = 0;
- DCHECK(!before.isEmpty() && before[before.length() - 1] == ' ');
+ DCHECK(!before.isEmpty());
+ DCHECK_EQ(before[before.length() - 1], ' ');
if (before.length() >= 2) {
last = before[before.length() - 2];
if (last == zeroWidthSpaceCharacter)
@@ -188,8 +189,10 @@ void NGLayoutInlineItemsBuilder::Append(
UChar character,
const ComputedStyle* style,
LayoutObject* layout_object) {
- DCHECK(character != spaceCharacter && character != tabulationCharacter &&
- character != newlineCharacter && character != zeroWidthSpaceCharacter);
+ DCHECK_NE(character, spaceCharacter);
+ DCHECK_NE(character, tabulationCharacter);
+ DCHECK_NE(character, newlineCharacter);
+ DCHECK_NE(character, zeroWidthSpaceCharacter);
text_.append(character);
unsigned end_offset = text_.length();
@@ -236,7 +239,8 @@ void NGLayoutInlineItemsBuilder::RemoveTrailingCollapsibleSpaceIfExists(
void NGLayoutInlineItemsBuilder::RemoveTrailingCollapsibleSpace(
unsigned* next_start_offset) {
DCHECK_NE(last_collapsible_space_, CollapsibleSpace::None);
- DCHECK(!text_.isEmpty() && text_[text_.length() - 1] == spaceCharacter);
+ DCHECK(!text_.isEmpty());
+ DCHECK_EQ(text_[text_.length() - 1], spaceCharacter);
unsigned new_size = text_.length() - 1;
text_.resize(new_size);

Powered by Google App Engine
This is Rietveld 408576698