From f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 29 Oct 2024 14:49:26 +0800 Subject: format * format * Minor test fixes * enable checking cpp format in ci --- source/slang/slang-core-module.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'source/slang/slang-core-module.cpp') diff --git a/source/slang/slang-core-module.cpp b/source/slang/slang-core-module.cpp index 5b163e594..df53bbf42 100644 --- a/source/slang/slang-core-module.cpp +++ b/source/slang/slang-core-module.cpp @@ -1,6 +1,6 @@ +#include "../core/slang-string-util.h" #include "slang-compiler.h" #include "slang-ir.h" -#include "../core/slang-string-util.h" #define STRINGIZE(x) STRINGIZE2(x) #define STRINGIZE2(x) #x @@ -8,18 +8,19 @@ namespace Slang { - String Session::getCoreModulePath() +String Session::getCoreModulePath() +{ + if (coreModulePath.getLength() == 0) { - if(coreModulePath.getLength() == 0) - { - // Make sure we have a line of text from __FILE__, that we'll extract the filename from - List lines; - StringUtil::calcLines(UnownedStringSlice::fromLiteral(__FILE__), lines); - SLANG_ASSERT(lines.getCount() > 0 && lines[0].getLength() > 0); + // Make sure we have a line of text from __FILE__, that we'll extract the filename from + List lines; + StringUtil::calcLines(UnownedStringSlice::fromLiteral(__FILE__), lines); + SLANG_ASSERT(lines.getCount() > 0 && lines[0].getLength() > 0); - // Make the path just the filename to remove issues around path being included on different targets - coreModulePath = Path::getFileName(lines[0]); - } - return coreModulePath; + // Make the path just the filename to remove issues around path being included on different + // targets + coreModulePath = Path::getFileName(lines[0]); } + return coreModulePath; } +} // namespace Slang -- cgit v1.2.3