Fix some nits in CPDF_Parser.
Change-Id: Ib4c6589a63761e8993e8cd33ed9459ba3d1e206c
Reviewed-on: https://pdfium-review.googlesource.com/23911
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp
index 0d1b02a..d8ac8c9 100644
--- a/core/fpdfapi/parser/cpdf_parser.cpp
+++ b/core/fpdfapi/parser/cpdf_parser.cpp
@@ -35,6 +35,7 @@
// this may be large enough in practice.
const int32_t kMaxXRefSize = 1048576;
+// "%PDF-1.7\n"
constexpr FX_FILESIZE kPDFHeaderSize = 9;
uint32_t GetVarInt(const uint8_t* p, int32_t n) {
@@ -167,7 +168,7 @@
case ObjectType::kCompressed:
return false;
}
- ASSERT(false); // NOTREACHED();
+ NOTREACHED();
return false;
}
@@ -395,7 +396,7 @@
// something is wrong with the cross reference table.
return false;
}
- return true;
+ break;
}
return true;
}
@@ -637,15 +638,13 @@
return true;
}
-bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos,
- bool bSkip) {
+bool CPDF_Parser::LoadCrossRefV4(FX_FILESIZE pos, bool bSkip) {
m_pSyntax->SetPos(pos);
std::vector<CrossRefObjData> objects;
if (!ParseCrossRefV4(bSkip ? nullptr : &objects))
return false;
MergeCrossRefObjectsData(objects);
-
return true;
}
@@ -1077,7 +1076,7 @@
}
}
- if (arrIndex.size() == 0)
+ if (arrIndex.empty())
arrIndex.push_back(std::make_pair(0, size));
pArray = pDict->GetArrayFor("W");