Change: Use std::make_unique instead of passing new() (#12539)

This commit is contained in:
Peter Nelson
2024-04-20 11:20:49 +01:00
committed by GitHub
parent fc7f184dbd
commit a1a01e21cf
6 changed files with 7 additions and 6 deletions

View File

@@ -224,7 +224,8 @@ static CTRunDelegateCallbacks _sprite_font_callback = {
CFAutoRelease<CTLineRef> line(CTTypesetterCreateLine(this->typesetter.get(), CFRangeMake(this->cur_offset, len)));
this->cur_offset += len;
return std::unique_ptr<const Line>(line ? new CoreTextLine(std::move(line), this->font_map, this->text_buffer) : nullptr);
if (!line) return nullptr;
return std::make_unique<CoreTextLine>(std::move(line), this->font_map, this->text_buffer);
}
CoreTextParagraphLayout::CoreTextVisualRun::CoreTextVisualRun(CTRunRef run, Font *font, const CoreTextParagraphLayoutFactory::CharType *buff) : font(font)