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

Unified Diff: core/fpdfapi/page/cpdf_colorspace.cpp

Issue 2453163002: Take advantage of implicit std::unique_ptr<>(nulltpr_t) ctor. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « core/fpdfapi/page/cpdf_clippath.cpp ('k') | core/fpdfapi/page/fpdf_page_func.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/page/cpdf_colorspace.cpp
diff --git a/core/fpdfapi/page/cpdf_colorspace.cpp b/core/fpdfapi/page/cpdf_colorspace.cpp
index fe840d10df373961a083a4187ea8caf9f8dab58f..e43bacc0790780394238579f1d0c245715de5b06 100644
--- a/core/fpdfapi/page/cpdf_colorspace.cpp
+++ b/core/fpdfapi/page/cpdf_colorspace.cpp
@@ -332,7 +332,7 @@ CPDF_ColorSpace* CPDF_ColorSpace::GetStockCS(int family) {
std::unique_ptr<CPDF_ColorSpace> CPDF_ColorSpace::Load(CPDF_Document* pDoc,
CPDF_Object* pObj) {
if (!pObj)
- return std::unique_ptr<CPDF_ColorSpace>();
+ return nullptr;
if (pObj->IsName()) {
return std::unique_ptr<CPDF_ColorSpace>(
@@ -341,7 +341,7 @@ std::unique_ptr<CPDF_ColorSpace> CPDF_ColorSpace::Load(CPDF_Document* pDoc,
if (CPDF_Stream* pStream = pObj->AsStream()) {
CPDF_Dictionary* pDict = pStream->GetDict();
if (!pDict)
- return std::unique_ptr<CPDF_ColorSpace>();
+ return nullptr;
for (const auto& it : *pDict) {
std::unique_ptr<CPDF_ColorSpace> pRet;
@@ -351,16 +351,16 @@ std::unique_ptr<CPDF_ColorSpace> CPDF_ColorSpace::Load(CPDF_Document* pDoc,
if (pRet)
return pRet;
}
- return std::unique_ptr<CPDF_ColorSpace>();
+ return nullptr;
}
CPDF_Array* pArray = pObj->AsArray();
if (!pArray || pArray->IsEmpty())
- return std::unique_ptr<CPDF_ColorSpace>();
+ return nullptr;
CPDF_Object* pFamilyObj = pArray->GetDirectObjectAt(0);
if (!pFamilyObj)
- return std::unique_ptr<CPDF_ColorSpace>();
+ return nullptr;
CFX_ByteString familyname = pFamilyObj->GetString();
if (pArray->GetCount() == 1)
@@ -386,11 +386,11 @@ std::unique_ptr<CPDF_ColorSpace> CPDF_ColorSpace::Load(CPDF_Document* pDoc,
} else if (id == FXBSTR_ID('P', 'a', 't', 't')) {
pCS.reset(new CPDF_PatternCS(pDoc));
} else {
- return std::unique_ptr<CPDF_ColorSpace>();
+ return nullptr;
}
pCS->m_pArray = pArray;
if (!pCS->v_Load(pDoc, pArray))
- return std::unique_ptr<CPDF_ColorSpace>();
+ return nullptr;
return pCS;
}
« no previous file with comments | « core/fpdfapi/page/cpdf_clippath.cpp ('k') | core/fpdfapi/page/fpdf_page_func.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698