Skip to content

Commit b6b9d31

Browse files
committed
Accepted suggestion
1 parent ec81084 commit b6b9d31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/CIR/CodeGen/CIRGenBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
3131
/// mlir::Builder::getStringAttr() which is an mlir::StringAttr.
3232
mlir::Attribute getString(llvm::StringRef str, mlir::Type eltTy,
3333
std::optional<size_t> size) {
34-
size_t finalSize = size ? *size : str.size();
34+
size_t finalSize = size.value_or(str.size());
3535

3636
size_t lastNonZeroPos = str.find_last_not_of('\0');
3737
// If the string is full of null bytes, emit a #cir.zero rather than

0 commit comments

Comments
 (0)