diff --git a/dom/canvas/WebGL2Context.cpp b/dom/canvas/WebGL2Context.cpp index f9a1eba4bff9..73083c964c81 100644 --- a/dom/canvas/WebGL2Context.cpp +++ b/dom/canvas/WebGL2Context.cpp @@ -138,7 +138,7 @@ WebGLContext::InitWebGL2(FailureReason* const out_failReason) //// - if (missingList.size()) { + if (!missingList.empty()) { nsAutoCString exts; for (auto itr = missingList.begin(); itr != missingList.end(); ++itr) { exts.AppendLiteral("\n "); diff --git a/dom/canvas/WebGLBuffer.cpp b/dom/canvas/WebGLBuffer.cpp index e8d883ff1958..c278c2721513 100644 --- a/dom/canvas/WebGLBuffer.cpp +++ b/dom/canvas/WebGLBuffer.cpp @@ -160,7 +160,7 @@ WebGLBuffer::BufferData(GLenum target, size_t size, const void* data, GLenum usa mIndexCache = Move(newIndexCache); if (mIndexCache) { - if (mIndexRanges.size()) { + if (!mIndexRanges.empty()) { mContext->GeneratePerfWarning("[%p] Invalidating %u ranges.", this, uint32_t(mIndexRanges.size())); mIndexRanges.clear(); @@ -251,7 +251,7 @@ WebGLBuffer::InvalidateCacheRange(size_t byteOffset, size_t byteLength) const invalids.push_back(range); } - if (invalids.size()) { + if (!invalids.empty()) { mContext->GeneratePerfWarning("[%p] Invalidating %u/%u ranges.", this, uint32_t(invalids.size()), uint32_t(mIndexRanges.size())); diff --git a/dom/canvas/WebGLContextDraw.cpp b/dom/canvas/WebGLContextDraw.cpp index 92ca2ea89aa6..512a25ad5c14 100644 --- a/dom/canvas/WebGLContextDraw.cpp +++ b/dom/canvas/WebGLContextDraw.cpp @@ -164,7 +164,7 @@ ScopedResolveTexturesForDraw::ScopedResolveTexturesForDraw(WebGLContext* webgl, ScopedResolveTexturesForDraw::~ScopedResolveTexturesForDraw() { - if (!mRebindRequests.size()) + if (mRebindRequests.empty()) return; gl::GLContext* gl = mWebGL->gl; diff --git a/dom/canvas/WebGLProgram.cpp b/dom/canvas/WebGLProgram.cpp index 365b8e178af8..6f7198bc7d89 100644 --- a/dom/canvas/WebGLProgram.cpp +++ b/dom/canvas/WebGLProgram.cpp @@ -1263,7 +1263,7 @@ WebGLProgram::ValidateAfterTentativeLink(nsCString* const out_linkLog) const // * Unrecognized varying name // * Duplicate varying name // * Too many components for specified buffer mode - if (mNextLink_TransformFeedbackVaryings.size()) { + if (!mNextLink_TransformFeedbackVaryings.empty()) { GLuint maxComponentsPerIndex = 0; switch (mNextLink_TransformFeedbackBufferMode) { case LOCAL_GL_INTERLEAVED_ATTRIBS: @@ -1283,7 +1283,7 @@ WebGLProgram::ValidateAfterTentativeLink(nsCString* const out_linkLog) const std::vector componentsPerVert; std::set alreadyUsed; for (const auto& wideUserName : mNextLink_TransformFeedbackVaryings) { - if (!componentsPerVert.size() || + if (componentsPerVert.empty() || mNextLink_TransformFeedbackBufferMode == LOCAL_GL_SEPARATE_ATTRIBS) { componentsPerVert.push_back(0); @@ -1608,7 +1608,7 @@ webgl::LinkedProgramInfo::MapFragDataName(const nsCString& userName, { // FS outputs can be arrays, but not structures. - if (!fragDataMap.size()) { + if (fragDataMap.empty()) { // No mappings map from validation, so just forward it. *out_mappedName = userName; return true; diff --git a/dom/canvas/WebGLTransformFeedback.cpp b/dom/canvas/WebGLTransformFeedback.cpp index 78e36653155a..da1b9986964f 100644 --- a/dom/canvas/WebGLTransformFeedback.cpp +++ b/dom/canvas/WebGLTransformFeedback.cpp @@ -62,7 +62,7 @@ WebGLTransformFeedback::BeginTransformFeedback(GLenum primMode) const auto& prog = mContext->mCurrentProgram; if (!prog || !prog->IsLinked() || - !prog->LinkInfo()->componentsPerTFVert.size()) + prog->LinkInfo()->componentsPerTFVert.empty()) { mContext->ErrorInvalidOperation("%s: Current program not valid for transform" " feedback.",