Codechange: use smart pointers when creating StringIterators
This commit is contained in:
@@ -443,9 +443,9 @@ int MacOSStringCompare(const char *s1, const char *s2)
|
||||
return this->utf16_to_utf8[this->cur_pos];
|
||||
}
|
||||
|
||||
/* static */ StringIterator *OSXStringIterator::Create()
|
||||
/* static */ std::unique_ptr<StringIterator> OSXStringIterator::Create()
|
||||
{
|
||||
if (!MacOSVersionIsAtLeast(10, 5, 0)) return nullptr;
|
||||
|
||||
return new OSXStringIterator();
|
||||
return std::make_unique<OSXStringIterator>();
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ public:
|
||||
size_t Next(IterType what) override;
|
||||
size_t Prev(IterType what) override;
|
||||
|
||||
static StringIterator *Create();
|
||||
static std::unique_ptr<StringIterator> Create();
|
||||
};
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user