From 7c5a8e869e3f5698f4302fa4717944b1753206f3 Mon Sep 17 00:00:00 2001 From: kaizhangNV Date: Thu, 16 Jan 2025 21:05:32 -0800 Subject: [PATCH] remove unnecessary lines --- include/slang.h | 2 +- source/slang/slang-check-conversion.cpp | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/slang.h b/include/slang.h index db01ac4dc0..356a2f496e 100644 --- a/include/slang.h +++ b/include/slang.h @@ -869,7 +869,7 @@ typedef uint32_t SlangSizeT; Language, MatrixLayoutColumn, // bool MatrixLayoutRow, // bool - ZeroInitialize, // bool + ZeroInitialize, // bool IgnoreCapabilities, // bool RestrictiveCapabilityCheck, // bool ModuleName, // stringValue0: module name. diff --git a/source/slang/slang-check-conversion.cpp b/source/slang/slang-check-conversion.cpp index 0c0b1aeba7..74870eb2e4 100644 --- a/source/slang/slang-check-conversion.cpp +++ b/source/slang/slang-check-conversion.cpp @@ -305,11 +305,10 @@ bool SemanticsVisitor::isCStyleStruct(StructDecl* structDecl) auto* elementType = arrayType->getElementType(); for (;;) { - ArrayExpressionType* nextType = as(elementType); - if (!nextType) + if (auto nextType = as(elementType)) + elementType = nextType->getElementType(); + else break; - - elementType = nextType->getElementType(); } if (auto elemStructDecl = _getStructDecl(elementType)) @@ -864,9 +863,7 @@ bool SemanticsVisitor::_coerceInitializerList( outToExpr, fromInitializerListExpr, argIndex)) - { return false; - } if (argIndex != argCount) {